jsor / lity

Lightweight, accessible and responsive lightbox.
https://sorgalla.com/lity/
MIT License
1.16k stars 196 forks source link

Hanging on Loading when in mobile only #196

Open john-Graham opened 6 years ago

john-Graham commented 6 years ago

I'm trying to sort out if I'm having a lity issue, a conflict or other. What's happening is when I load on mobile, I get the black background and the word loading but it hangs on there and the console is showing...

Uncaught TypeError: Cannot read property 'on' of undefined at new x (lity-min.js:5) at HTMLAnchorElement.y (lity-min.js:5)

specifically starting at: (.on("click","[data-lity-close]",

I'm on jQuery 1.12.1 so I'm not sure there's any dependency issues.

I have the page up and would be curious if you have any thoughts. https://www.edgewood.edu/admissions/freshman-students

jsor commented 6 years ago

You're probably calling on() on a HTMLElement, not on a jQuery instance. You must ensure to wrap the element like $(element).on(...) instead of element.on(...).

john-Graham commented 6 years ago

I'm not calling it programmatically, just added the data attribute.
`

Meet Kourtni

`

Also tried `

Meet Kourtni

`

I'll try doing it programmatically and see if that makes a difference.

john-Graham commented 6 years ago

Same issue when calling it through the console. Interestingly it's working on the newest Android OS and on iPhone if you do the force touch it will work. Baffling.