• HOME
  • showcase
  • Documentation
    • Codegenerator
    • Code Examples
      • Multiple 360 images
      • infinite-loop
    • Integration
      • Wordpress
      • Joomla
    • API Document
    • Enable Cloudzoom
    • How to create images
    • Features in action
  • Download
    • Free version
    • No creditsign
    • Releases
  • Installation service
  • Contact
    • Contact
    • Twitter
    • Partners

How to Make an Infinite Loop

Share
When you 360 presentation has been loaded you might want to rotate it until your visitor do something with it. A normal animation takes 360 degrees (or less) and then stops. This example use the event when your presentation has loaded and when an animation has ended.
<script type="text/javascript" src="http://360-javascriptviewer.appspot.com/latest/js/3dweb.latest.js"></script>

<script type="text/javascript">
var x = new Create3D();
//Give the created instance the parameters for the presentation.
 x.startValues({ totalFrames: 72,//amount of pictures
 imageUrl: 'http://360-javascriptviewer.appspot.com/images/ipod/ipod_[#frame].jpg', //url to images where [#frame] is a value like 01,10,22
 imageBigUrl: 'http://360-javascriptviewer.appspot.com/images/ipod/big/ipod_[#frame].jpg', //url to images where [#frame] is a value like 01,10,22
 info: true,//shows de console with notifications and errors
 tag: 'product_image_x', //The id of the image wich will replaced by the 360 image
 pictureDirection: false, // true for right false for left
 rotationSpeed: 8.3, //1 is slow, 10 is fast
 rotationEnding: 4,//slowing down after rotation
 license:'0x2a76e84a2d8aa6e3a73eb6a11708dce2', //put here your licensecode and the 360 logo is gone
 clickCallback: 'zoomOption()',//the function if someone is clicking on the presentation
 });
</script>

<script type="text/javascript">
//first we add some events so we know when and when an animation has ended	
x.customEvents.addListener("build", functionAfterBuild);
x.customEvents.addListener("done", functionAfterAnimation);	
setTimeout("x.start()", 2000); //start with a delay so IE can follow also
function functionAfterBuild(){
	//start the animation
		x.startAnimation(5000, 360, 'none', 5, -2, 1, 0);
}
function functionAfterAnimation(){
	//what to do when the animation ends? We just start it again
	functionAfterBuild();
}
</script>

<div id="image_holder_x">
        <img src="http://360-javascriptviewer.appspot.com/images/ipod/ipod.jpg" id="product_image_x" /></div>
</div>
Share

Learning Centre

  • Implementation guide
  • Cloudzoom
  • How to create images
  • Features in action

Put it on your own domain

  • No credit sign
  • Change images/ css
  • Script on your server
  • Unlimited number of presentations on a domain
  • support and updates