2
I’m trying to make an animation that behaves like a toggle. What I want is that with the click Event on #admin > p
, this deviates to the left while the #admin > form, #btn
slideup and go back to the original position (css) when #admin > form, #btn
slide down again.
Here is my odious poop:
$('#admin > p').click(function(){
$('#admin > form, #btn').stop(true).slideToggle();
})
$('#admin > p').toggle(function() {
$(this).animate({'left':'20px'});
}, function() {
$(this).animate({'right':'20px'});
});
Miguel, can you add your HTML to make it clearer? (or even make it jsFIddle)
– Sergio
You want one to appear the other to disappear, and vice versa?
– Gustavo Rodrigues
Here is jsFiddle. Note: I don’t know what’s going on but in my browser it works. The '#admin > p' goes left but what I wanted is to turn dps to the original position qd the 'form' is Hidden. Obgado I put this code because at least it works once, I am sure you understand what I mean. Obgado http://jsfiddle.net/dW6Mb/
– Miguel