JavaScript API

You can use this JavaScript API when interacting with the 360° view on your site with JavaScript.

instanceId definition
The 360° view is inserted into HTML using this syntax:

The important part is the product3d_demo id. This is the instanceId that is used to identify this rotation, in case there is more than one rotation in a page.

RotateTool.get()
Calling this command like this:

Will return the first 360° view instance in the page.

Will return the instance with the id ‘product3d_demo’.

myInstance.startLoadingImages()
Will resume loading the images when the option “showStartButton” is active in preloader settings.

myInstance.stopRotation()
Will stop the rotation.

myInstance.startRotation()
Will start the rotation.

myInstance.getImageId()
Returns the current id of the image shown. The images ids are set 0… images.length-1

myInstance.setImage(id)
Forces the instance to show an image with given id.

myInstance.isSpinning()
Returns true/false if the view is rotating.

myInstance.dx
Returns -1 or 1 or 0 – the actual direction of rotation.

Need more API? Please contact me!