Page 1 of 1

Gallery Large Amount of Images

Posted: Thu Sep 17, 2015 4:34 pm
by Barrowboy
Does anyone know how to to pre-load a large amount of images with in the Gallery.

When selecting the Gallery it takes an age to load all the images.

We are using the latest cmcms 1.12.1 and Gallery 2.0.2

Thanks for any help

Re: Gallery Large Amount of Images

Posted: Thu Sep 17, 2015 4:43 pm
by Rolf
Use the Gallery pagination for this.
Or use endless scrolling http://www.cmscanbesimple.org/blog/cmsm ... -scrolling

Re: Gallery Large Amount of Images

Posted: Thu Sep 17, 2015 6:50 pm
by velden
Barrowboy wrote:Does anyone know how to to pre-load a large amount of images with in the Gallery.

When selecting the Gallery it takes an age to load all the images.

We are using the latest cmcms 1.12.1 and Gallery 2.0.2

Thanks for any help
Not sure what you mean by 'preloading'.

I guess you can preload images when you display a page with none, one or only a few images. If the page (html source) contains more 'links' to the rest of the images AND the (js) logic to preload that could work.
When selecting the Gallery it takes an age to load all the images.
This suggests that you display all images on the page (that's why it takes long) but don't think there's a way to preload.

Re: Gallery Large Amount of Images

Posted: Fri Sep 18, 2015 11:23 am
by Jos
In stead of pre-loading, take a look at lazy loading: only load the visible images. https://plugins.jquery.com/lazyload/

You can find an example here: http://tinyurl.com/q72rnmu
It is easy to integrate this in a Gallery template.

Re: Gallery Large Amount of Images

Posted: Sun Sep 20, 2015 7:13 am
by Barrowboy
Hi All

Thanks for your suggestions.

Just to explain a little more, we have over 1000 images in one gallery on a gallery page, these are paginated into 30 images per page.

I idea of a pre load would be that on first visiting to the site the images would load from the home page in the background thereby when selecting the gallery page there would be no delay or very little.

I will take a look at the lazy load plug to see if that would help.

Thanks

Re: Gallery Large Amount of Images

Posted: Sun Sep 20, 2015 10:21 am
by velden
I'm certainly not an expert on this subject

Do you realize that, depending on chosen method and implementation, this could increase data usage a lot? Because users that visit your homepage will (at least) download 30 (and in worst case implementation 1000) images while you're not sure they will actually visit the gallery.

Then, if they do visit the gallery is it sure, or very likely, they start at page one?

I do think there are some methods to let a browser load images into the browser's cache. Probably you need to use the pagination logic to know which images (next 30?) to pre-load. And I think it would involve some ajax to actually get the 'links' to the next 30 images.