html - prevent div getting pushed down on toggle with jquery -
i have 2 divs that's open on-click. function works pretty smooth except first div keeps pushing down second div. want them stay on each others side.
i created js fiddle, http://jsfiddle.net/qskxa/1/
i think problem in html file ?
thanks
<div id="artistsbox"> <div class="artist"> <ul class="ulartists"> <li> <span class="toggle">artist 1</span> <div class="toggle_hide"> <p> hello world</p> </div> </li> <li> <span class="toggle">artist 2</span> <div class="toggle_hide"> <p> hello world</p> </div> </li> </ul> </div> </div>
i'm not 100% sure you're looking (is buttons want side-by-side?) if use css positioning, can remove hidden images flow of document, avoiding pushdown:
.toggle_hide{ display:none; position: relative; } .toggle_hide img { position: absolute; left: 0; top: 0; }
change values/positioning suit needs :)
Comments
Post a Comment