试图让它在屏幕上从左到右然后向下移动,我目前正在努力通过单击按钮将图片移动到正确的位置,但它不是动画的
function myMove()
{
var himg = document.getElementById( parameter.pictureID );
himg.style.left = (himg.style.left +1700) +"px";
himg.style.top = (himg.style.top+ 700) +"px";
setTimeout(myMove,20); // call doMove() in 20 msec
}
最佳答案
您可以通过 CSS3 过渡来实现此目的;
http://www.w3schools.com/css/css3_transitions.asp
放置转换:左10s,前10s;在您要移动的元素上,您还可以从其他转换功能中受益
关于javascript - 从左到右然后向下动画图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35688607/