anvaka / panzoom

Universal pan and zoom library (DOM, SVG, Custom)
https://anvaka.github.io/panzoom/demo/attach-via-script.html
MIT License
1.83k stars 293 forks source link

Multiple panzoom? #316

Open xsshello opened 11 months ago

xsshello commented 11 months ago

Hello, how can I make multiple svgs?

Now I do it like this:

    let paths = document.querySelectorAll('div svg')
    paths.forEach((elem) => {
        instance.elem = panzoom(elem, {
            minZoom: 1
        });
    });

but have problem with catch events, I don't know how to refer to them - instance[0].getTransform(); not working

or better is to do one panzoom and switch them via destroy it somehow?