aseemk / zoomit-lightbox

Zoom.it-powered Lightbox — an infinitely better experience for hi-res images.

Home Page:http://aseemk.github.io/zoomit-lightbox/test/gallery.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto-init immediately, and support refreshing

aseemk opened this issue · comments

Right now, we only support "initializing" once, so to be safe (in case this script is included in the <head>), we wait to auto-init until window.onload (since ondomready isn't trivial to implement and we don't want to take a dependency on jQuery, etc.).

This is really suboptimal though, because if you have a lot of images on your page, we won't init until all of them have loaded -- which could be super delayed.

So we should auto-init immediately -- optimizing for the recommended best practice of including the script at the bottom of <body> -- and support "refreshing" (updating) both manually and automatically on window load.