View Full Version : SimpleGallery

06-08-2011, 09:51 PM
1) Script Title: SimpleGallery

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm

3) Describe problem:


I have a problem. My gallery has many pictures and I wish that the script does not preload all the images at startup. For example, it would be nice if the image charge at the time of display. Is this possible?

Sorry for my English.

Thank you in advance for your help.

06-08-2011, 09:53 PM
Sorry I forgot to write the title

06-09-2011, 02:12 AM
On the script page it tells you how to prevent the images from preloading by changing one word.

It says to change:

The above is located in the simplegallery.js file


06-09-2011, 06:26 AM
Not exactly. The preloadfirst is an option and you set it to true or false in the on page call, example (from Step 1 on the demo page, addition highlighted):

<script type="text/javascript">

var mygallery=new simpleGallery({
wrapperid: "simplegallery1", //ID of main gallery container,
dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg", "http://en.wikipedia.org/wiki/Swimming_pool", "_new", "There's nothing like a nice swim in the Summer."],
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "", ""],
["http://i30.tinypic.com/531q3n.jpg", "", "", "Eat your fruits, it's good for you!"],
["http://i31.tinypic.com/119w28m.jpg", "", "", ""]
autoplay: [true, 2500, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
preloadfirst: false,
oninit:function(){ //event that fires when gallery has initialized/ ready to run
//Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
onslide:function(curslide, i){ //event that fires after each slide is shown
//Keyword "this": references current gallery instance
//curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
//i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)


If you don't set it, it defaults to true, which is probably what you currently have.

06-09-2011, 07:20 AM
Thank you for your answers but it changes nothing. All images will load at the start of the opening of the page.

See image attached

06-09-2011, 07:29 AM
Please post a link to a page on your site that contains the problematic code so we can check it out.

06-09-2011, 07:41 AM
Sorry I can not not in production, is developing.
I had misconfigured, now it's ok for firefox but in IE9 images are all loaded at the start of the page

Thank you

06-09-2011, 07:50 AM
I did not say is that my firefox was cached images. it opens all the images on the page is opened.

06-09-2011, 08:04 AM
Try this version of the script:


06-09-2011, 12:28 PM
Thank you very much for your help! With this version it works as I want.