<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.</p>
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: 6,//slowing down after rotation
license:'', //put here your licensecode and the 360 logo is gone
clickCallback: 'zoomOption()'//the function if someone is clicking on the presentation
});
</script>
<div id="image_holder_x"> <img src="http://360-javascriptviewer.appspot.com/images/ipod/ipod.jpg" id="product_image_x" /></div> </div>
x.silentLoader()If you use the silentloader or not this is the way to start the animation. If you do this directly after opening the page use the setTimeout function for 2 seconds. Otherwise IE is giving troubles.
x.start();or with a timeout
setTimeout("x.start()", 2000);
x.customEvents.addListener("build", functionAfterBuild);
x.customEvents.addListener("done", functionAfterAnimation);
x.customEvents.addListener("preload", functionDuringPreload);
x.customEvents.addListener("drag", functionDuringDrag);
x.customEvents.addListener("loaded", functionAfterPreload);
x.setValue("rotationSpeed", newValue); //or
x.setValue("rotationEnding", newValue);
or use the get function
var currentRotationSpeed = x.getValue('rotationSpeed');
var currentRotationEnding = x.getValue('rotationEnding');
var totalFrames = x.getValue('totalFrames');
var currentFrame = x.getValue('frameNo'); //now you know where your visitor is looking at
var howManyFramesAreLoaded = x.getValue('loaded');
x.silentLoader()But we want to know when the silentLoader is finished loading so we can display our button.
x.customEvents.addListener("loaded", showImage);
Now we need the function ‘showImage’ to activate the button.
function showImage(){
document.getElementById("btn_loaded").style.visibility = "visible";
}
And of course we need the button image with the id ‘btn_loaded’ on our page. With this button we start the presentation. We do that by giving the instance x the method start();
<a href="javascript:x.start()"><img src="http://www.3dweb.nl/create3d/images/icon_rotate_51x56.png" id="btn_loaded" style="visibility:hidden;" /></a>
x.startAnimation(speed, degrees, 'none', a, b, c, 0)speed: how many ms does the animation takes degrees: what is the angle, 0 for animation to frame ‘none’ : type of animation (soon there will be more) a,b,c: parameters for the animation 0: The number of the frame where the animation ends. 0 for degree input.