jackmoore / zoom

jQuery plugin for zooming images on mouseover.
http://www.jacklmoore.com/zoom/
MIT License
1.54k stars 459 forks source link

Not Working in angular - $img.stop() #150

Open LinoMacKay opened 3 years ago

LinoMacKay commented 3 years ago

Hi Jack i've been trying to use in Angular but im having an issue with events and zooming. I get an error every time i mouse over it

ERROR TypeError: $img.stop is not a function at HTMLDivElement.stop (jquery.zoom.js:121) at HTMLDivElement.handle (jquery.slim.min.js:2) at HTMLDivElement.dispatch (jquery.slim.min.js:2) at HTMLDivElement.v.handle (jquery.slim.min.js:2) at ZoneDelegate.invokeTask (zone-evergreen.js:406) at Object.onInvokeTask (core.js:28521) at ZoneDelegate.invokeTask (zone-evergreen.js:405) at Zone.runTask (zone-evergreen.js:178) at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:487) at invokeTask (zone-evergreen.js:1600)

And core.js:6157 ERROR TypeError: $img.stop is not a function at HTMLDivElement.start (jquery.zoom.js:130) at HTMLDivElement.handle (jquery.slim.min.js:2) at HTMLDivElement.dispatch (jquery.slim.min.js:2) at HTMLDivElement.v.handle (jquery.slim.min.js:2) at ZoneDelegate.invokeTask (zone-evergreen.js:406) at Object.onInvokeTask (core.js:28521) at ZoneDelegate.invokeTask (zone-evergreen.js:405) at Zone.runTask (zone-evergreen.js:178) at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:487) at invokeTask (zone-evergreen.js:1600)

I already imported jquery in angular and also the plugin.

This is the way i use it. //Component.ts ngOnInit(): void { jQuery(document).ready(function($){ ( $('#ex1') as any) .zoom(); });