Initializing FSI TouchZoom

Initializing or adding images manually

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


I) let FSI.TouchZoom initialize automatically and add image manually: 


Example:
<script type="text/javascript 
src="/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>


II) initialize FSI.TouchZoom manually after adding your images:



Example:
<script type="text/javascript 
src="/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>