适用于 IE 6 的 Jquery 旋转图像 >
我希望有人能够阐明 IE 6 >图像旋转代码。我尝试过使用 (http://code.google.com/p/jquery-rotate/ )没有成功。我可以根据这篇文章旋转图像(Stackoverflow 帖子)适用于 FF、Chrome 和 Safari。
任何以 45 度角旋转图像的帮助或指示将不胜感激。谢谢。
示例:我的旋转测试
I was hoping someone could shed light on IE 6 > image rotation code. I have tried using (http://code.google.com/p/jquery-rotate/) with no success. I'm able to rotate the image based on this post (Stackoverflow post) for FF, Chrome and Safari.
Any help or direction to rotate an image at 45deg angle would be appreciated. Thanks.
Example: My test for rotation
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用优秀的 jQuery Rotate 插件。 http://code.google.com/p/jqueryrotate/。所有主流浏览器都支持
要旋转图像,您需要做的就是
$('#myImage').rotate(30) //for a 30 Degree spin
其中
#myImage
是要旋转的元素的 id。Use the excellent jQuery Rotate plugin. http://code.google.com/p/jqueryrotate/. It is supported by all major browsers
To rotate an image, All you need to do is
$('#myImage').rotate(30) //for a 30 degree rotation
Where
#myImage
is the id of the element you want rotated.在我看来,CSS3 是最佳选择,因为(在这种情况下),您只需执行
transform:rotate(xxdeg);
即可。有一些方法可以确保向后兼容性,例如: http://fetchak.com/ie-css3/希望有帮助!
In my opinion, CSS3 is the way to go, because (in this scenario), you can just do
transform: rotate(xxdeg);
. There are methods for ensuring backwards compatibility, such as this: http://fetchak.com/ie-css3/Hope it helps!
您读过吗... http ://developercity.blogspot.com/2010/09/rotate-div-or-image-using-jquery-ie-and.html
编辑:
试试这个:http://pastebin.com/gB4iATpm
Did you read... http://developercity.blogspot.com/2010/09/rotate-div-or-image-using-jquery-ie-and.html
EDIT:
Try this: http://pastebin.com/gB4iATpm
这是一个老问题,但自从提出这个问题以来,事情已经发生了变化,所以如果人们仍在阅读这篇文章,我将提供一个效果很好的替代解决方案:
对于当前使用的所有浏览器(IE8 及更早版本除外),最简单的旋转元素的解决方案是标准 CSS 语法
transform:rotate(45deg)
。对于 IE6/7/8,最好的选择是 CSS Sandpaper JavaScript 库。
CSS Sandpaper 实现了标准的 CSS 旋转语法以及其他几个 CSS 功能。这意味着您可以在所有浏览器中使用标准 CSS 语法。
这样做的好处是,这意味着虽然你使用的是 IE 的 javascript,但其他浏览器不需要涉及任何 JS 代码,这应该对性能有好处。在支持 Web 标准的浏览器上使用它们也很好。
This is an old question, but things have moved on since it was asked so in case people are still reading this, I'll chip in with an alternative solution that works well:
For all browsers in current use except IE8 and earlier, the simplest solution for rotating an element is the standard CSS syntax
transform:rotate(45deg)
.For IE6/7/8, the best option is the CSS Sandpaper javascript library.
CSS Sandpaper implements standard the CSS rotation syntax, along with several other CSS features. This means you can use standard CSS syntax in all browsers.
The good thing about this is that it means that although you're using javascript for IE, you don't need to involve any JS code for other browsers, which should be good for performance. It's also good to be using the web standards on browsers that support them.