我正在测试旋转的图像jquery
。参考在这里(示例5)。我的代码中缺少什么,单击后图像不会旋转?
<html>
<head>
<title>Rotate Image</title>
<script type="text/javascript" src="jquery.js"/>
<script type="text/javascript" src="jQueryRotate.js"/>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$("#image").rotate({
bind:
{
click: function(){
$(this).rotate({ angle:0,animateTo:180,easing: $.easing.easeInOutExpo })
}
}
});
});
</script>
<img src="images/aaa1.jpg" id="image"/>
</body>
</html>
包裹 :
您错过了包括jQuery核心
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script>
<script type="text/javascript" src="jQueryRotate.js"></script>
同样,script标签的结束标签应该是 </script>
<html>
<head>
<title>Rotate Image</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jQueryRotate.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function(){
$("#image").rotate({
bind:
{
click: function(){
$(this).rotate({ angle:0,animateTo:180,easing: $.easing.easeInOutExpo })
}
}
});
});
</script>
<img src="http://placehold.it/64" id="image"/>
</body>
</html>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句