javascript旋转图像
问题描述:
我在我的网页上有旋转图像。
链接如下:javascript旋转图像
http://equosinfotech.com/testdemo/test.html
一切工作正常,因为我想,我只是想放慢形象作为其过快的旋转速度,我无法找到一个方法来减缓它下。
(你可以看到代码的页面源)
我只是需要有人帮我旋转减慢。
的javascript我使用:
var stop = function(){
$("#image").rotate({
angle:0,
animateTo:0,
callback: stop,
easing: function (x,t,b,c,d){ // t: current time, b: begInnIng value, c: change In value, d: duration
return c*(t/d)+b;
}
});
}
$(document).ready(function()
{
rotation();
$("#image").rotate({
bind:
{
mouseover : function() {
stop();
},
mouseout : function() {
rotation();
}
}
});
});
var rotation = function() {
$("#image").rotate({
angle: 0,
animateTo: 360,
callback: rotation,
easing: function(x, t, b, c, d) { // t: current time, b: begInnIng value, c: change In value, d: duration
return c * (t/d) + b;
}
});
}
答
试加在你的代码,以$("#image").rotate({..
的duration:2000,
,或者有多少secconds你想(2000年为2秒的millisecconds)。
总是在问题本身**中包含相关的代码和标记**,不要只是链接。为什么:http://meta.stackexchange.com/questions/118392/add-stack-overfow-faq-entry-or-similar-for-putting-code-in-the-question – 2012-04-16 11:09:13