[Javascript] Re: scrollbars

Dash forgetful54341087097153001984 at hotmail.com
Thu Mar 31 10:51:25 CST 2005


>Anyway, document.body is a much quicker way to express it.
>

Are there any browsers other than IE which dont use document.body?

>Secondly, the element which IE makes the visual root and thus gives 
>scrollbars changes. In IE5 and Quirks mode it's <body>, in IE6 Standards 
>mode it's <html>. (The standards actually say it shouldn't be either of 
>them, but that's another story.) So to do it in either mode:
>
>   if (ie_win) { // sniffed using whatever is your favourite method
>     var r;
>     if (document.compatMode=='CSS1Compat')
>       r= document.documentElement;
>     else
>       r= document.body;
>     r.style.overflow= 'auto';
>   }

ok, i modified the script to make it work. In the body tag of the page, i've defined style="overflow:hidden;", so surely i dont need to check for document.documentElement (if it's defined in the html file in the body tag, it wouldn't shift anywhere else, would it?). 

But this doesn't actually make the browser display (or hide) the scrollbars. I've checked, and it DOES change the document.body.style.overflow value of the DOM, but it i think the page needs to be refreshed for this to take effect, is there a way to refresh the page, without the user having to actually reload all the graphics?

I want to be able to do this because i dont want the user to be able to scroll down the page until an event occurs.

Thanks,

Dash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050331/2520c285/attachment.htm>


More information about the Javascript mailing list