3 FSI TouchZoom
95
NeptuneLabs - FSI Viewer
3.4 JavaScript Interface
Usually you will not need to use the javascript interface.
Even if you modify an images src parameter at runtime, the tool will notice that and
replace the magnified image accordingly.
If you on the other hand add images to the DOM tree at runtime or modify the
position of images by script, the following interface is available to update the images
and positions:
FSITouchZoom = new $FSI.TouchZoom();
FSITouchZoom.init();
I) Public Methods
void
scanForNewImages();
Calling the scanForNewImages method will make the script
look for single source images that have not been present in
the DOM tree when the document finished loading. If you
e.g. add <img> tags at runtime, you need to call this method
in order to make the script aware of new image(s).
void
addImage(elImg, strSrc);
This adds a single <img> node to the list of dynamic touch
zoom images.
elImg
: the <img> node object
strsSc
(optional): the image URL (img.src if undefined)
Note:
you can as well call
scanForNewImages()
after
adding an <img> node.
void
removeImages(arImageDOMElements, bSilent);
Removes one or more touch zoom images and restores their
original state.
arImageDOMElements:
an <img> node object or an array
of <img> node objects