Javascript jqueryonmouseover函数
我需要使用Jquery在mouseover函数上旋转图像 file.jsJavascript jqueryonmouseover函数,javascript,jquery,Javascript,Jquery,我需要使用Jquery在mouseover函数上旋转图像 file.js $("#logo").rotate({ bind: { mouseover: function () {$(this).rotate({ animateTo: 180 })}, mouseout: function () {$(this).rotate({ animateTo: 0
$("#logo").rotate({
bind:
{
mouseover: function ()
{$(this).rotate({ animateTo: 180 })},
mouseout: function ()
{$(this).rotate({ animateTo: 0 })}
}
});
HTML
<script type="text/javascript" src="../script/file.js"></script>
<img id="logo" src="../images/logo.png" alt="none" />
这个代码有什么错误吗?顺便说一句,我在网上找到了这个代码。
JavaScript中没有函数调用rotate(),那么它如何工作呢?请提供任何链接,以便我能理解
如果这个问题看起来很愚蠢,请忽略它:)。rotate()
不是函数。你引用的插件是否正确?
这一定是导致问题的原因。看起来您正试图使用某个使用自定义JQuery插件的代码段
JQuery中没有用于旋转图像的内置函数。有很多插件可供使用,例如和。从这里下载jquery.rotate.1-1.js,并在调用之前将其包含在脚本标记中 我需要从image onmouseover()调用函数,那么我应该用rotate()替换什么呢?一把小提琴给你