I reached the goal for the slider:
jsFiddle: http://jsfiddle.net/YeP4Y/5/
Starting line 230:
magnifyexternal: function($tracker, newpower, zoomRange)
{
var specs=$tracker.data('specs')
var magnifier=specs.magnifier, od=specs.imagesize, power=specs.curpower
var magnifier2=specs.magnifier2, od=specs.imagesize, power=specs.curpower
var nd=[od.w*newpower, od.h*newpower]
magnifier.$image.css({width:nd[0], height:nd[1]});
magnifier2.$image.css({width:nd[0], height:nd[1]});
specs.curpower=newpower
specs.$statusdiv.html('Current Zoom: '+specs.curpower);
jQuery("input:radio[name=radioZoomLevel][value="+newpower+"]").attr('checked', true);
this.showstatusdiv(specs, 0, 500);
$tracker.trigger('mousemove');
},
Around line 402:
$("#imageZoomLevel").bind('change', function(){
fiz.magnifyexternal($tracker,$(this).val(), setting.zoomRange)
});
This is not exactly what you want (since it is not attached externally, only internally), but it works.
To make it work from the outside, I would do the following:
- find a way to capture the plugin instance (for example, by calling $ ('selector'). imageZoomCompare ('get')
- calling magnifyexternal () method on this instance
source
share