直接上代码:
$(function(){ $(".pic").mouseover(function(){ if(!($(this).is(":animated"))){ $(this).animate({"top":"-15px",},200).animate({"top":"-0px",},200) .animate({"top":"-12px",},200).animate({"top":"-0px",},200) .animate({"top":"-6px",},200).animate({"top":"-1px",},200) .animate({"top":"-1px",},200).animate({"top":"-0px",},200); } }); });
if(!($(this).is(":animated"))) //不让其反复弹动