Hi Expert,
I like to create a animate when user click on a button.There are two animate function I like to do on click so I thought to use toggle function which swap between two function.
Now problem is if I use toggle function it doing the two animate function without click and also the button disappears.
$('#button').toggle(
function() {
$('#slider').stop().animate({"margin-right": '0'});
},
function() {
$('#slider').stop().animate({"margin-right": '50'});
}
);
Here slider is the div which animates.
How to do the animate functions alternatively every time when user click a button?
Thanks in advance.
AVADHESH PATEL
06-Jun-2013