Hi there,
I want to always show vertical scrollbar in my webpage. How it is possible using javascript? I think it is possible using javascript or jQuery. I want vertical scrollbar whether there is enough content to show or not.
thanks.
Hi there,
I want to always show vertical scrollbar in my webpage. How it is possible using javascript? I think it is possible using javascript or jQuery. I want vertical scrollbar whether there is enough content to show or not.
thanks.
jQuery shouldn't be required. You could try adding the CSS:
body {overflow-y:scroll;}
This works across the latest browsers, not sure about ie6 though.
http://www.w3schools.com/jsref/prop_style_overflow.asp
set overflow property of a containing div to "scroll"
try calling a function on the onload method of your body tag and in that function change the style of body like this document.body.style.overflow = 'scroll'; also you might need to set the width of your html as this will show horizontal scroll bars as well
your html file will look something like this
<script language="javascript">
function showscroll() {
document.body.style.overflow = 'scroll';
}
</script>
</head>
<body onload="showscroll()">