tags:

views:

936

answers:

3

I have a div.

I want that user should not be able to scroll the page if the height is more than 350px. Also the scroll bar should be visible in disable mode in that case.

I want to achieve this using javascript.

Thanks

+3  A: 

I can't say I completely understood what you want, but I think what you're looking for is CSS not javascript. Take a look at the overflow property.

Adrian Mester
How can I achieve this using CSS?
He says right there in the answer. It's even linked. Just a little bit more effort to click it.
annakata
+1  A: 

Seems like you're looking for overflow: hidden; perhaps?

roosteronacid
overflow:hidden will hide the scrollbars. But I want scrollbars to be visible bit in the disable mode.
That's not possible by conventional means. What problem are you trying to solve? Why do you want to show scroll-bars if they are not meant to be used?
roosteronacid
I want to disable scrollbars in some condition.If I hide the scrollbar then the page shakes a bit(because page width increases). thats why I want to disable it.