【发布时间】:2010-11-16 04:06:01
【问题描述】:
这是我到目前为止所管理的,但似乎没有人可以帮助我完成最后几个功能:
<script type='text/javascript''>
$(document).ready(function () {
swing();
});
function swing() { //making the div swing
$('#share').animate({right: '210px'}, 1000, function(){swingback()});
}
function swingback() { //making the div swing back
$('#share').animate({right: '220px'}, 1000, function(){swing()});
}
$('#share').mouseenter(function() { // stop any animation if the mouse enters the div
$(this).stop();
}).mouseleave(function() { // continue animation once the mouse has left the div
swingBack();
});
</script>
【问题讨论】:
-
那么它现在做了什么?它是无法停止,还是重新开始?
标签: jquery animation html hover