如何使用 jquery 旋转插件旋转图像? [英] Howto rotate image using jquery rotate plugin?

查看:24
本文介绍了如何使用 jquery 旋转插件旋转图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 jQuery-rotate 插件旋转图像?p>

我尝试了以下方法,但似乎不起作用:

<html><头><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>查看照片</title><script type="text/javascript" src="scripts/jquery.js"></script><script type="text/javascript" src="scripts/jquery.rotate.1-1.js"></script><脚本类型="文本/javascript">变量角度 = 0;setInterval ( 函数 (e) {旋转();}, 100 );函数旋转(){角度 = 角度 + 1;$('#pic').rotate(角度);}</脚本></头><身体><img 边框="0" src="player.gif" name="pic" id="pic"></身体></html>

还需要大多数浏览器支持的其他方法,谢谢!

解决方案

你在 jQuery 和 jQuery 插件上得到了 404.因此,您的页面会引发 JavaScript 错误,即 $ 未定义.

您需要学习基本的 JavaScript 调试技术.快速搜索后发现这篇文章看起来是一个不错的起点:

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!

解决方案

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.

You need to learn basic JavaScript debugging techniques. A quick search found this article that looks like a good place for you to start:

这篇关于如何使用 jquery 旋转插件旋转图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆