如何使用jquery旋转插件旋转图像? [英] Howto rotate image using jquery rotate plugin?
本文介绍了如何使用jquery旋转插件旋转图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 jQuery-rotate 插件旋转图像?
How do you rotate an image using jQuery-rotate plugin?
我尝试过以下操作但似乎不起作用:
I have tried the following and it doesn't seem to work:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>View Photo</title>
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/jquery.rotate.1-1.js"></script>
<script type="text/javascript">
var angle = 0;
setInterval ( function (e) {
rotate();
}, 100 );
function rotate() {
angle = angle + 1;
$('#pic').rotate(angle);
}
</script>
</head>
<body>
<img border="0" src="player.gif" name="pic" id="pic">
</body>
</html>
大多数浏览器都支持其他方法,谢谢!
Other methods that are supported by most browsers are wanted too, thanks!
推荐答案
你有一个关于jQuery和jQuery插件的404。因此,您的页面会抛出JavaScript错误,$ $未定义。
You've got a 404 on jQuery and the jQuery plugin. Because of that, your page is throwing a JavaScript error, that $ is not defined.
您需要学习基本的JavaScript调试技巧。快速搜索发现这篇文章看起来像是一个很好的起点:
You need to learn basic JavaScript debugging techniques. A quick search found this article that looks like a good place for you to start:
- JavaScript Debugging Techniques with Firebug
这篇关于如何使用jquery旋转插件旋转图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文