i m trying to animate a image on mouse over and i want that it animate back to it normal position without using mouseout.
$(document).ready(function() {
$("#bysti-menu li").mouseover(function(){
var $elem = $(this);
$elem.find('.uprmenuicon')
.animate({
'margin-top':'-40px'
},400,'easeOutBack').animate({
'margin-top':'0px'
},400,'easeOutBack')
}).mouseout(function(){
// do nothing
});
});
here when i put mouseover the image its margin becomes -40px but i want that immediately after that it becomes normal to 0px even when mouse is not yet out ? can anyone help me in this ?
You could set up your function to listen for what type of event is happening: http://jsfiddle.net/dn9wD/1/