javascript - Shifting elements in a div with overflow auto -


i experiencing problem layout of page controls shifting when attempt change class using javascript event. can ideas around problem. seems problem in ie when left scroll bar appears.

here example of html

<div id="container" style="overflow:auto;">   <div id="control1container" style="left:17%;top:145px;display:inline;position:absolute;">      <div id="control1" class="listout" >i control</div>   </div>   <div id="control2container" style="left:67%;top:145px;display:inline;position:absolute;">      <div id="control2" class="listout" >i control</div>   </div><!-- more controls here --> </div> 

so imagine controls within container div take enough space overflow margin appears on left i.e. controls extend below bottom of container div. if attempt change listout class on control1 listin using javascript control shift left. me seems browser readjusting control1container new location 17% if container div's new width scrollbar in place.

any idea's?

you need give container div position:relative, absolute positioned elements inside positioned in relation ..


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -