[英]Change rotate animation position
I am trying to implement rotate animation its working but I want to change the div position. 我正在尝试实现旋转动画的工作,但是我想更改div的位置。 Here is my code:- 这是我的代码:
$(function(){
var el=$('div');
el.animate({ deg: 180 }, {
duration: 1000,
step: function (now) {
el.css({
transform: 'rotate(' + now + 'deg)'
});
},
complete: function () {
},
});
});
I want this position(now its first but I want second):- 我想要这个职位(现在是第一个,但我想第二个):
Thanks for your hepl 谢谢你的帮助
$(function(){
var el=$('div');
var topik = $('div').css('top');
el.animate({ deg: 180 }, {
duration: 1000,
step: function (now) {
el.css({
transform: 'rotate(' + now + 'deg)',
top : topik+'500px',
});
},
complete: function () {
},
});
})
Dont thank me ;););) 不用谢我;););)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.