In my application I have a div that is hidden to 90%. The rest of the div is revealed if you click on the part you see. The div slides down 200px and when it's all down I want it to bounce a couple of times. Below is the code, but by some reason the bouncing doesn't work.
I would really appreciate if someone could help me out!
var boxDown = false;
$('#uploadContainer').click(function(){
if (boxDown === false) {
$(this).animate({
'marginTop': "+200px"
});
$(this).effect("bounce", { times:3 }, 300);
boxDown = true;
}
else {
$(this).animate({
'marginTop': "-=200px"
});
boxDown = false;
}
});
Personally, I would use jQuery easing function: http://gsgd.co.uk/sandbox/jquery/easing/
look at the
easeOutBounce
oneYou use it like this: