In Firefox……
<div id='container' style='overflow:scroll; width:400px; height:500px'> <div id='content' style='height:500px; width:800px'/> </div>
The ‘container’ DIV should have scroll bars since the div with id ‘content’ is wider than it.
If, using JavaScript (see below), I reset the size of the ‘content’ div to ‘200px’, I would expect the scroll bars on the div ‘container’ to disappear. They dont, unless I manually resize the the browser window.
function Resize() { document.getElement('content').style.width='200px'; }
I tried forcing a reflow on container by applying a css class. This didnt work…
function Resize() { document.getElement('content').style.width='200px'; document.getElement('container').className='test'; }
Setting
overflow: scroll;should force scrollbars to be on. If you want them to appear and disappear with the content size, tryoverflow: auto;