jackmoore / wheelzoom

A small script for zooming IMG elements with the mousewheel/trackpad.
http://www.jacklmoore.com/wheelzoom
MIT License
342 stars 95 forks source link

Not working on dynamically added image source #11

Closed kidach closed 6 years ago

kidach commented 9 years ago

I populate image source with image path i got from ajax. Something like $('#image').attr('src', resultFromAjax);

Am i doing something wrong? :)

dantaeyoung commented 9 years ago

Not sure if this helps, but adding 'var' to the main declaration on line 20 fixed a "Uncaught TypeError: object is not a function" error for me: var main = function(img, options){

gelevanog commented 8 years ago

You can try to use imagesLoaded for that - http://imagesloaded.desandro.com/