Skip to main content

Initializing or adding images manually

If you are adding images by script, you can decide to:

Automatic Initialization

Let FSI.TouchZoom initialize automatically and add image manually:

Example:
<script type="text/javascript" src="//yourdomain.com/fsi/viewer/applications/touchzoom/js/fsitouchzoom.js"></script>

<script type="text/javascript">
addMyImagesToTheDom(); // add your images here
// make FSI.TouchZoom look for new images
$FSI.touchZoom.scanForNewImages();
</script>

Manual Initialization

Initialize FSI.TouchZoom manually after adding your images:

Example:
<script type="text/javascript" src="//yourdomain.com/fsi/viewer/applications/touchzoom/js/fsitouchzoom.js"></script>

<script type="text/javascript">
// prevent $FSI.TouchZoom from initializing automatically
// on document load
$FSI.touchZoomParameters = {autoInit:false};
function onBodyLoaded() {
addMyImagesToTheDom(); // add your images here

// create and initialize FSI.TouchZoom
var parameters = {debug:true, useDevicePixelRatio:true};
myTouchZoom = new $FSI.TouchZoom();
myTouchZoom.init(parameters);
}
</script>