...

View Full Version : Overflow-y



Nightfire
09-25-2002, 07:59 PM
I'm creating a site just made in css and divs, I have overflow-y:scroll which makes the div scrollable in IE, but how can I do this for NS/Mozilla? The text is just going down the page.

Bosko
09-25-2002, 08:31 PM
Use this simple script:


<script>
document.getElementById("div_id").style.overflow="hidden";
document.getElementById("div_id").style.overflow="-moz-scrollbars-vertical";
</script>

Where "div_id" is the ID of your DIV tag.

Nightfire
09-25-2002, 08:39 PM
Thanks :)

Nightfire
09-25-2002, 09:02 PM
Just modified it a little as it was throwing an error in IE5, incase anyone else wants it

if(document.all){
document.getElementById("content1").style.overflow="auto";
}else{
document.getElementById("content1").style.overflow="-moz-scrollbars-vertical";
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum