I would like to glide over several divs, as is done in this script:
http://jsfiddle.net/jakecigar/XwN2L/2154/
The functionality of this script is good, but I need the hidden content to slide up before the next content slides down in sequence.
In addition, when you click on the active div link when it is open, it will cause it to move and be hidden, as is done for the site menu.
Here is the HTML:
<style>.targetDiv {display: none}</style> <a class="showSingle" target="1">Div 1</a> <a class="showSingle" target="2">Div 2</a> <a class="showSingle" target="3">Div 3</a> <a class="showSingle" target="4">Div 4</a> <div id="div1" class="targetDiv">Lorum Ipsum1</div> <div id="div2" class="targetDiv">Lorum Ipsum2</div> <div id="div3" class="targetDiv">Lorum Ipsum3</div> <div id="div4" class="targetDiv">Lorum Ipsum4</div>
Here is the script:
jQuery(function(){ jQuery('.showSingle').click(function(){ jQuery('.targetDiv').slideUp(); jQuery('.targetDiv').hide(); jQuery('#div'+$(this).attr('target')).slideToggle(); }); });
source share