rustytanton-zz / ie6-upgrade-warning

Automatically exported from code.google.com/p/ie6-upgrade-warning
0 stars 0 forks source link

Use overlay for entire page, not just the window width and height. #71

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The issue was that people could scroll down and then access certain parts of 
the site. That's not good. 

So I modified the code to use the overlay for the entire page width and height. 

Change out: 

  document.documentElement.clientHeight

with

  document.body.clientWidth

And then for a simple way to get the warning window to stay in the visible 
frame, replace:

  _dd.style.top = ((_height-_ddh)/2)+"px"

with

  _dd.style.top = "50px"

Produces a much better result. You could also rejig it so that it positions the 
box to the middile of the visible screen but covers the entire body with the 
overlay. 

JP Out.

Original issue reported on code.google.com by JoshuaPi...@gmail.com on 23 Sep 2011 at 4:28

GoogleCodeExporter commented 8 years ago
i implemented this and it looks awesome. but for some reason the overlay covers 
my entire page, except about 40 pixels at the way bottom. any suggestions as to 
why this might be happening?

Original comment by stevenru...@gmail.com on 3 Nov 2011 at 6:41

GoogleCodeExporter commented 8 years ago
That's because the original solution has got a typo - it references "width" 
instead of "height". To correct:-

Replace;

    document.documentElement.clientHeight

with

    document.body.clientHeight

And then to retain the overlay centered on the visible viewport, replace;

    _dd.style.top = ((_height-_ddh)/2)+"px"

with
    _dd.style.top = ((document.documentElement.clientHeight-_ddh)/2)+"px"

Original comment by stu.chur...@gmail.com on 22 Feb 2012 at 10:45

GoogleCodeExporter commented 8 years ago
Very true, thanks for the correction.

Original comment by JoshuaPi...@gmail.com on 22 Feb 2012 at 3:12

GoogleCodeExporter commented 8 years ago
Thank you!! for the last point about covering all the page!!

Original comment by evansgar...@gmail.com on 30 Aug 2012 at 9:56

GoogleCodeExporter commented 8 years ago
You bet. 

Would you consider officially moving this over to Github and possibly merging 
the changes that these guys made: 

https://github.com/jbueza/IE6-Warning-with-Localizations
https://github.com/rtgibbons/ie-upgrade-warning
https://github.com/monobasic/ie-upgrade-warning

I would love to develop this a bit further as well and much prefer 
collaborating on GitHub.

Cheers,

Josh

Original comment by JoshuaPi...@gmail.com on 31 Aug 2012 at 6:54