[英]moving back and forth div
Im trying to create some moving div, actually remake one, so that div would move endlessly back and forth, here is the script: 我试图创建一些移动的div,实际上重制一个,所以div将无休止地来回移动,这是脚本:
function animate(px) {
$('.download').animate({
'marginLeft' : "-10px"
});
}
Thanks for help! 感谢帮助! ;)
;)
Don't forget to add position: relative
to the #download
element before doing this: 在执行此操作之前,不要忘记添加
position: relative
对于#download
元素:
var func = function() {
$(".download").animate({"left": "-40px"}, 1000, function() {
$(this).animate({"left": "40px"}, 1000)
})
setTimeout(func, 2000);
}
//Or remove setTimeout and use the following line instead:
//func(); setInterval(func, 2000);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.