fat / zoom.js

Medium's Image Zoom for jQuery
https://fat.github.io/zoom.js
MIT License
4.04k stars 332 forks source link

Uncaught TypeError: Cannot read property '0' of undefined #90

Open weituotian opened 6 years ago

weituotian commented 6 years ago
Uncaught TypeError: Cannot read property '0' of undefined
    at o._touchStart (zoom.min.js:8)
    at HTMLDocument.i (jquery-1.9.1.min.js:3)
    at HTMLDocument.dispatch (jquery-1.9.1.min.js:3)
    at HTMLDocument.v.handle (jquery-1.9.1.min.js:3)
o._touchStart @ zoom.min.js:8
i @ jquery-1.9.1.min.js:3
dispatch @ jquery-1.9.1.min.js:3
v.handle @ jquery-1.9.1.min.js:3

image

evanart commented 6 years ago

Came across this issue too. Wrapping the function in () fixed it for me.

so instead of:

function ($) { "use strict";

....

} (jQuery);

make it:

(function ($) { "use strict";

....

}) (jQuery);

I'm no expert on this stuff but for whatever reason that fixed it for me.

ghost commented 6 years ago

:heavy_check_mark: Try my version of zoom.js!