Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In a 'div' element, I defined the ContentPane's style as below:
HTML
<div id="rightPane" dojotype="dijit.layout.ContentPane" style="width: 250px; overflow-x:scroll; overflow-y:scroll;" region="right">

But the vertical scrollbar (where overflow-y:scroll or overflow-y:auto) does not function as needed. There are 2 bugs:
1) If the items in the panel are not expanded, I want to the scrollbar in 'hidden' status. But it is always on even though I set overflow-y:auto.
2) When the items are expanded, the scrollbar still behaves like it before, and can't be scrolled down.
I need a script to dynamically change the scrollbar status. Hopefully you can help me for this piece of code. Thanks in advance.
Posted
Comments
Richard Deeming 13-Nov-14 9:34am    
"overflow-y:scroll;"
"even though I set overflow-y:auto"

Which is it? You say you've set it to "auto", but your code shows you've set it to "scroll".
s yu 13-Nov-14 11:26am    
I tried both: overflow-y:auto and overflow-y:scoll. Same appearance.

1 solution

It is a sample code i have worked,It works fine

XML
<div id="scroll">
    <p>Try to add more text</p>
 </div>
here's the css code

#scroll {
   overflow-y:auto;
   height:auto;
   max-height:200px;
   border:1px solid black;
   width:300px;
 }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900