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:
function animate(px) {
$('.download').animate({
'margin开发者_如何学JAVALeft' : "-10px"
});
}
Thanks for help! ;)
Don't forget to add position: relative
to the #download
element before doing this:
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);
精彩评论