Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create a function which calls a function
    text
    copied!<p>I'm using a jquery file which has a image zoom functionality:</p> <p><a href="http://www.albanx.com/jslibs/axzoomer.js" rel="nofollow">http://www.albanx.com/jslibs/axzoomer.js</a></p> <p>Everything is working fine. But now i need a feature which is not included with the plugin. On the zoom activating event the default zoom level should be changed.</p> <p>I've tryied something like this:</p> <pre><code>imageLoaded:function() { return this.each(function() { var $this = $(this); $this.zoomInOut(1.5); // zoomInOut(1.5); }); }, </code></pre> <p>But no luck... Since i'm not sure how the functions are working in jQuery, and the zoomInOut is the function inside function as i figured out...</p> <p>Any help is appreciated.</p> <p><strong>UPDATE</strong></p> <p>The function displayed before is integrated into this js file:</p> <p><a href="http://www.ifmi.lt/public/axzoomer/axzoomer-1.5.js" rel="nofollow">http://www.ifmi.lt/public/axzoomer/axzoomer-1.5.js</a> ( Line 382 ).</p> <p>For those who does not know hot the axzoomer works: you need to provide 2 images one in normal size, another the big size for zoom. Then the initial zoom starting by scaling the small image, when the scale of image is more than 1.2 then the big image is loading.</p> <p>In my code since i'm using the <code>jquery.reel</code> library also i customized a bit the axzoomer approach. When zoom button is clicked then this function is being called:</p> <pre><code>function zoomImage () { var value = Number ( $('#image360').attr('src').split ( '_' )[1].split ( '.' )[0] ); $('#zoom-content').load( initiateZoom ); $('#zoom-content').attr ( 'src', 'products/1/' + value + '.jpg' ); $('#zoom-content').attr ( 'src-big', 'product/1/zoom/' + value + '.jpg' ); $('#zoom-content').axzoomer({ 'maxZoom':3, 'opacity':0.5, 'sensivity':17, 'showControls':false, 'zoomIn':'', 'zoomOut':'' }); } </code></pre> <p>After the small image has been loaded, the <code>initiateZoom</code> function is called. The <code>axzoomer ( 'imageLoaded' );</code> function is reachable from js, it is called when the small image is loaded:</p> <pre><code>function initiateZoom() { $('#zoom-content').axzoomer ( 'enable' ); $('#zoom-content').axzoomer ( 'imageLoaded' ); } </code></pre> <p>But inside of the imageLoaded ( in the axzoomer.js function starting on line 382 ) i can not reach the zoomInOut function, to zoom the image on initial load.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload