[thelist] Help with providing a backup to javascript solution

Jacob Reiff jacob at jaacob.com
Thu Jan 26 21:29:30 CST 2006


On Jan 26, 2006, at 5:49 PM, Jacob Reiff wrote:

>
>> 2) The black screen doesn't really scroll all the way down -- it only
>> scrolls down one viewport's worth of the page.  The
>> black screen only scrolls down to "the fold". As it is, you can
>> click on the passion link
>> and have a dialog box pop up whose contents are off the screen (for
>> the most part).
>
> I'm aware of this issue and have been trying to figure out how to fix
> it. Currently the divs are absolutely positioned - maybe switching to
> fixed positioning to force them to the center of the viewport will
> fix the problem. There might be a javascript solution to get the divs
> to center in the viewpoint regardless of where the scrollbar is, but
> I don't know it. The "black screen" is a div set to height: 100%,
> which is the issue with the break at the fold - perhaps changing it
> to a very large number and then setting the red box div to fixed will
> alleviate all my problems here!
>

Ok, I've done some testing but have come up short of a solution. I  
made the "black screen" div much larger (2000px square) in an effort  
to make sure it covers all content - but this adds scrollbars to  
cover all that real estate. When the red box is set to fixed, this  
isn't an issue because it stays in the center of the screen (on  
firefox and safari) regardless of where you scroll around to, and as  
soon as you close the red box, the scrollbars shrink up (kind of a  
cool effect, actually). The problems with using position: fixed on  
the red box are:

1) IE/Win positions the box in the upper left corner of the viewport,  
which is pretty ugly looking. I have the the IE7 script running,  
which I thought enabled perfect support of position: fixed, but not  
in this case.

2) If you scroll around at all in Safari, the image replacement  
technique I used mucks up and the "behind-the-scenes" text appears  
over the graphic. Of course, I don't know how much scrolling you'd  
actually do since the box is fixed in the center and isn't going  
anywhere without clicking close, but still.


I tried setting the black screen div to a fixed position as well, to  
avoid the huge scrollbars appearing - but then it removes all  
scrollbars, period. Not a problem (in theory) if the red box was set  
to fixed as well, but it does create weird graphic glitches in  
firefox where the scrollbars once were.

If anybody has a solution to enables me to calculate the scrollable 
(?) size of the browser window so that I can generate the proper  
exact size the black screen needs to be in order to cover all real  
estate but not generate extra, as well as make the red box stick in  
the center regardless of scrolling (without using position: fixed I  
guess) - I'd really appreciate it.

(Sorry for the length!)

Jacob



More information about the thelist mailing list