rotating a product image with javascript only
I just browsed the apple iphone 4 gallery and stumbled upon the 360° view of the new iphone (see http://www.apple.com/iphone/gallery/, click on the 4th image from the left in the thumbnails view). First I thought it would be a flash movie which lets you rotate the iphone image, but as I inspected it with firebug I found out thats just plain html enhanced with javascript. The javascript chang开发者_高级运维es the image src as I move the mouse. I browsed through the included javascript files but gave up quickly as they are all minified and not really readable.
So my question is: how do you do this in javascript? Is there a plugin for one of the popular javascript libraries that can accomplish a 360° view of a product just by using html, javascript and product photos taken from the various angles?
Here we are : http://www.mathieusavard.info/threesixty/demo.html
The script for the rotation is in vr.js, but it is complicated.
If you're looking for a pure-CSS technique that doesn't involve lots of images and works in IE7 and up, check out these examples:
- http://www.romancortes.com/blog/pure-css-skull-with-flames/
- http://www.romancortes.com/blog/pure-css-coke-can/
精彩评论