jquery .slideToggle pushes content up -
i have divs want show/hide .slidetoggle. expect .slidetoggle force content downwards when expands, , pull content below when contracts.
but seems force content and/or scroll downwards when expands, causing jumpy animation.
here fiddle: http://jsfiddle.net/photocurio/x785b/
$('.milford-directions').click(function() { $('#milford').slidetoggle(); }); $('.tufts-directions').click(function() { $('#tufts').slidetoggle(); }); $('.our-affiliations').click(function() { $('#affiliations').slidetoggle(); });
this happening because have id anchor href. default, when clicking on anchor id href, page scroll id.
take when remove id: http://jsfiddle.net/x785b/5/
<a class="our-affiliations directions">first box</a></p> you can prepare using preventdefault or return false
http://jsfiddle.net/x785b/7/
jquery
No comments:
Post a Comment