I started playing around with Brice's jqModal and ran into an odd bug
that is specific to Safari 1 and 2. I'll keep this as short as
possible, but here's are the details.

The Goal
The goal was to allow modal content on a page, knowing that some modal
content would have a vertical height taller than the browser's
viewport.

The Solution
To allow scrolling of the viewport, I changed the position of the
modal container from fixed to absolute in the CSS and it worked as
expected.

The Odd Safari Problem
If you list a set of links with a <br /> tag separating them, have
positioning set to absolute and the modal content is taller than the
viewport, Safari crashes. But if you wrap the links in <p> tags or
have the positioning set to fixed, there's no problem.

Demos
I set up 2 demos that recreate the problem, just follow these steps:

Step 1: Open Safari
Step 2: Set viewport to a height of 400px or smaller
Step 3: Hit Refresh
Step 4: Load http://nonsponsored.com/jqmodal/good.html and click the
'Open modal content' link
Result: You will see the modal content open and it will be taller than
the viewport but allow you to scroll.

Then to see it crash, follow the above steps again but load in
http://nonsponsored.com/jqmodal/bad.html. This time, Safari will crash
without loading the page.

The only difference between the 2 html files is that the one that
crashes has a <br /> tag after the modal content link.

Good: <a href="javascript:void(0)" class="showMoreViews">Open modal
content</a>
Bad: <a href="javascript:void(0)" class="showMoreViews">Open modal
content</a><br />

Any thoughts on why the <br /> is causing this?

Reply via email to