Using jquery.panzoom

Hi,

I have installed jquery.panzoom through npm (https://www.npmjs.com/package/jquery.panzoom) but I can’t seem to import it for use within a jQuery function in my typescript file.

For jQuery itself, this line works fine: import * as $ from 'jquery';

I had to add the typings for jquery too.

On the other hand, I can’t figure out the syntax to import jquery.panzoom. I’ve tried:

import panzoom from 'jquery.panzoom';
import Panzoom from 'jquery.panzoom';
import { panzoom } from 'jquery.panzoom';
import { Panzoom } from 'jquery.panzoom';

No luck. Does anyone have any ideas?

Thanks.

don’t you need a path in there?

I thought no path, it assumed node_modules

I’m having the same problem. Did you solve it?

I did now!! Use the import like this!

import ‘jquery.panzoom’;

just that.

Using the panzoom:

$(".panzoom").panzoom({
      $set: $('#image')
    });