ryanve / response.js

Responsive design toolkit
http://responsejs.com
Other
801 stars 123 forks source link

Programmatically lazy-loading content? #47

Closed indrek-k closed 10 years ago

indrek-k commented 10 years ago

I have a page with a large number of galleries. When the user clicks on a gallery thumbnail, a lightbox with that gallery's images is opened. I'd like to be able to lazy load the gallery contents, but not before the lightbox is opened. Is there a way to do this?

ryanve commented 10 years ago

Try deferring the call to Response.create until then (and not using body[data-responsejs] because that calls it automatically). Or try a pure CSS lightbox. If using a JavaScript lightbox, you may be better off just calculating the dimensions with Response or verge and then use .setAttribute to set the [src].

indrek-k commented 10 years ago

Looks like I'll just use verge and set the src attributes myself. Thanks!

ryanve commented 10 years ago

Sure thing—go for it!

verge has been easier to maintain because it's smaller and more focused, hence #19