Hi all,
If you would like to have the horizontal toggle options, according to example when you click on the button to slide, it will play the animation reversed and hide the element. See the below example to toggle slide a div.
Script:-
$(document).ready(function(){
$('#slide').click(function(){
$('.box').animate({
'right' : $('.box').css('right') == '0px' ? '130px' : '0px'
}, 200);
});
});
Html:-
<div class="wrap">
<div class="box">center</div>
<button type="" id="slide">Slide</button>
</div>
Output :-
0 Comment(s)