lokesh / lightbox2

THE original Lightbox script (v2).
http://lokeshdhakar.com/projects/lightbox2/
MIT License
6.17k stars 1.76k forks source link

Bug fix for onload race condition #626

Closed olwimo closed 6 years ago

olwimo commented 6 years ago

Proposed fix for bug illustrated on https://jsfiddle.net/olwimo/h633q2re/ Please note that this is a quick&dirty fix off the top of my head, and I haven't done any testing yet; I'll do a few quick tests soon, just to be sure I haven't missed some obvious fault/better solution, but I'm not too familiar with lightbox, so it's better if you guys find the "right" way to fix it anyway - I just didn't want to report the bug without at least suggesting a way to fix it.

Pull Requests are welcome. But note that v2 of Lightbox is in Maintenance Mode and no new features will be added. See the Roadmap.

PRs submitted will still be reviewed and then kept open for other users to utilize.

olwimo commented 6 years ago

Obvious better solution on https://github.com/lokesh/lightbox2/pull/627