如何在JavaScript中进行图像3D旋转 [英] How to make image 3d Rotation in JavaScript

查看:75
本文介绍了如何在JavaScript中进行图像3D旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想用JavaScript而不是3d格式制作3d旋转按钮,请看这张图片:http://i32.servimg.com/u/f32/14/92/15/95/pictur10.png

可以用Java完成吗?我在css中创建了一个,但在IE之外无法使用.

Hello I want to make a 3d rotation button by JavaScript, not 3d formation, look at this picture: http://i32.servimg.com/u/f32/14/92/15/95/pictur10.png

can it done in java? I created one in css but didn''t work on other than IE.

推荐答案

您好,

这可以使用CSS3 animationkeyframes3dtransform 在HTML5/CSS3中完成,并且将在除IE9/lower和Opera外的所有浏览器中工作.另外,您也可以仅使用CSS3 3dtransform 和JavaScript来完成此操作,该功能将在除IE9/lower和Opera外的所有浏览器中运行.您最后的选择是尝试使用SVG或Canvas和JavaScript,并检测鼠标单击以创建3D旋转图像,该图像可以像单击按钮一样被单击.我不建议使用这最后一个选项.

可以在 www.w3schools.com [ ^ ].请参阅他们的HTML5,CSS3和JavaScript教程/完整的参考资料/完整的示例(所有内容!).您可以轻松地在Internet上查找所有内容,而无需询问是否进行了一点搜索-搜索"HTML 3d"会将此页面(您需要的最重要的页面)放在列表​​的第二位: W3Schools CSS3 3D转换 [ ^ ].令您惊讶的是,您设法创建了仅在IE中起作用的东西……这是Java插件吗?如果是这样,那使我感到惊讶.不需要Java插件. HTML5/CSS3/Javascript可以为您做到这一点,只要您不介意它在IE9/lower和Opera中不起作用. IE10确实支持这一点.即将推出的Opera版本将支持它.

希望这会有所帮助,
Ed
Hi there,

This can be done in HTML5/CSS3 using CSS3 animation, keyframes and 3dtransform and will work in all browsers except IE9/lower and Opera. Alternatively, you can do it using just CSS3 3dtransform and JavaScript and that will work in all browsers except IE9/lower and Opera. Your final option is to try and use SVG or Canvas and JavaScript and detect mouse clicks to create a 3D rotating image that can be clicked on as though it were a button. I do not recommend this last option.

All of the info for doing all of this (including an understanding of programming JavaScript) can be found on www.w3schools.com[^]. Please see their HTML5, CSS3 and JavaScript tutorials/complete references/complete examples (for everything!). You could easily have looked all this up on the internet without asking a question if you just searched a little bit - a search for "HTML 3d" puts this page (the most important one that yuo need) just second in the list: W3Schools CSS3 3D Transforms[^]. I am surprised you managed to create something that worked only in IE...was it a Java plugin? If so, that nulls my surprise. Java plugins are not necessary. HTML5/CSS3/Javascript can do this for you provided you don''t mind it not working in IE9/lower and Opera. IE10 does support this. Coming versions of Opera will support it.

Hope this helps,
Ed


这篇关于如何在JavaScript中进行图像3D旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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