Erin Doak schrieb:
> I like your work. Here are a few suggestions.
> 
> If the link to activate the greybox is near the bottom of the page and the 
> page had to be scrolled to show the link, the greybox will appear not in the 
> middle of the visible window but back up near the top.
> 
> If the page has scrollbars and the user scrolls the page while the greybox is 
> visible the overlay is shown to not cover the entire page.
> 
> A horizontal scroll bar appears in FF.
> 
> If the page is scrolled with the greybox visible the greybox does not 
> recenter itself.


I solved that for my lightbox very simply. Most greybox/lightbox 
solutions center the box dynamically, i.e. it has to be recentered on 
scroll and resize. That's clumsy.

Simply use a fixed positioning and you can get rid of the event handlers 
completely. Example:

.greybox {
     position: fixed;
     top: 50%;
     left: 50%;
}

You then only need to push the box half of its width and height to the 
left/top via negative margin. This needs to be done via JavaScript if 
these values are dynamic, i.e. in the show/positioning function.

IE6 needs extra care, but you can emulate the fixed positioning with 
dynamic properties.

I have posted a complete solution a while ago here, if you are interested...


-- Klaus


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to