javascript - Jquery panzoom on click -


looking implement jquery plugin allows zoom svg elements. https://github.com/timmywil/jquery.panzoom

what having issues implementing zoom functionality when user clicks on element, while using 'duration' parameter available in framework.

an example

var $section = $('section').first();             $panzoom = $section.find('.panzoom').panzoom({                 contain: false,                 minscale: 1,                 maxscale: 3,                 contain: true,                 duration: 1200             }).panzoom('zoom', true); 

some html

<element class='test'/> 

some click handler

$('.test').on('click' function(){      $panzoom.panzoom("zoom", 2.5);  }); 

this zoom in, not use 'duration' provided.

it looks calling zoom zoom in, , calling zoom true parameter zoom out. doesnt seem zooming maxscale.

//in   $panzoom.panzoom("zoom"); //out   $panzoom.panzoom("zoom", true); 

just guess, api, expect call more this...

... first setup selectors...

var $section = $('section').first(),     $panzoom = $section.find('.panzoom'); 

... later on ...

$('.test').on('click' function(){     $panzoom.panzoom("zoom", 2.5, {             contain: false,             minscale: 1,             maxscale: 3,             contain: true,             duration: 1200         }); }); 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -