I'm using "Swinxy Zoom" javascript library (jQuery based) to have a nice magnifying effect on an image.
So far so good, I achieve the expected feature by binding the zoom event to the relevant tag. See code below.
$(this).swinxyzoom({mode:'dock', zoom: 14 });
By default, this library triggers the zoom on hover. However, I'd like to trigger this on click instead, I manage to do this (see code below), but I can't find how to unbind the swinxyzoom plugin once the focus is out of the image.
$('a.swinxyzoom').click(function(e) {
e.preventDefault();
$(this).swinxyzoom({mode:'dock', zoom: 14 });
/* here some code that unbinds the zoom on "mouse out" of image */
});
I suspect there might be a built-in feature already implemented, as my proposed solution is only a work around really. I double checked the Swinxy Zoom doc but could not find anything matching my requirement, maybe I missed something?