Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Simple Controls Gallery v1.3 help with starting pic

  1. #1
    Join Date
    Nov 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Simple Controls Gallery v1.3 help with starting pic

    1) Simple Controls Gallery v1.3
    2) http://www.dynamicdrive.com/dynamici...plegallery.htm
    3) My problem:
    i want to start showing slideshow not from 1st picture, but e.g. from 3rd pic, need to have loaded on the start not first pic as is on default

    i'm sure it ensures this function, but didn't find any information how to use it

    onslide:function(curslide, i){ //event that fires after each slide is shown
    //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)
    }

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    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)
    	oninit:function(){ //event that fires when gallery has initialized/ ready to run
    		//Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
    		this.showslide(2);
    	},
    	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)
    	}
    })
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah works as i wanted


    i just one more thing , i can see like first pic is loading then it's switched to defined nr of pic. is there any way how to stop loading that first one, it doesn't look very well

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You could just change the order of the slides so that the one you want comes first. Or you could just wrap your gallery in a division, ex:

    Code:
    <div id="mywrapper1" style="visibility:hidden;">
    <div id="simplegallery1"></div>
    </div>
    Then in the oninit:

    Code:
    	oninit:function(){ //event that fires when gallery has initialized/ ready to run
    		//Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
    		this.showslide(2);
    		document.getElementById('mywrapper1').style.visibility = visible;
    	},
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Nov 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i have it here:

    http://www.autobazar.eu/sk/facal.html

    it works ok when you click on 3rd, 5th, 7th... but when i click on almost last one, i can see 1st pic loaded and shown that requested one immediately after it,
    is there any way yet how to fix it?

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't see the Simple Controls Gallery v1.3 on that page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Nov 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    lol, pres any pic , i showed that url because it really depends what pic you start with...

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You should have explained that. I will look into it later. Have you tried my suggestion to use a wrapping division?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Nov 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sure i pasted your code
    mywrapper1 is hidden...

    you can see it on the last pics like it's refreshing from 1st loaded picture...

    http://www.autobazar.eu/sk/pics2.php?id=892760&pic=14
    http://www.autobazar.eu/sk/pics2.php?id=892760&pic=15

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well of course, it's doing exactly that in all cases. It's just that if the image is ready it happens too fast for you to notice. The script preloads all of the images in order, so the last one(s) will take the longest to get ready.

    Now I'm assuming that you are using PHP to write out the page with the number of the desired image in our custom oninit function. Something like (my PHP isn't the best):

    PHP Code:
    this.showslide(<?php echo ($_GET(pic) - 1); ?>)
    Whatever you are doing, we can move things around and change them a little and hopefully get it to wait until it has slid to reveal the image. But it will depend upon what the script means by onslide. If it mens what I think it does, it might work out:

    Code:
      oninit:function(){ //event that fires when gallery has initialized/ ready to run
    		//Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
    		this.showslide(13);
    	},
    	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(i == 13)
    		document.getElementById('mywrapper1').style.visibility = visible;
    	}
    So however you are getting the number, have it appear in the two places as shown in the above (13 highlighted red). Give that a shot and see what happens.

    It would probably also help if the larger images weren't as large. Try optimizing them for a lower byte count, and consider reducing their dimensions some as well.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •