Advanced Search

Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Can't get more images to show with this code?

  1. #11
    Join Date
    Oct 2013
    Posts
    57
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    OK first here are both sites the code is on:

    http://itistheride.boards.net/

    http://www.thescooterprofessor.proboards.com/

    Now I went in and cleaned up the suggested things, changed the AMOUNT to 7 to go with the ARRAY 0f 7. Took out the space at the end of one of the image lines and made the code change as John said and all is well.

    Now one last question John? If I want to add more images in the array just be sure the Amount and array = the same number of images, correct?

    Thanks
    Last edited by jscheuer1; 11-05-2013 at 01:43 PM. Reason: Format

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,704
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    Yes and no. You can follow that practice and things will work out. But array declaration doesn't have to be so formal, in fact it's better if it's not. Instead of doing (formal array declaration):

    Code:
    var grphcs = new Array(6);
    You can just do (informal array declaration):

    Code:
    var grphcs = [];
    Now it doesn't matter how many images there are in the array as long as there's at least one. The number of images shown at once is what the Amount controls. So if you have only one image and the amount is 10, you will see ten of the same image at a time. If you have 20 images in the array and the amount is still 10, you will see only the first ten.

    This is the same in the more recent code, except with it, each time the page loads the images are shuffled, so if you have more images in the array than set for in the amount property, different ones will be used each time the page loads.
    - John
    ________________________

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

  3. #13
    Join Date
    Oct 2013
    Posts
    57
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Ok so if I set this code section like this:


    Code:
    var speed=60  // 12 to whatever (60 is pretty slow) higher numbers are slower
    Amount=7; //Smoothness depends on image file size, the smaller the size the more you can use!
    
    //Pre-load your image below!
    var grphcs = [];
    Image0=new Image();
    Image0.src=grphcs[0]="http://www.jr-richscooterdoc.com/HW/skel1.gif ";
    Image1=new Image();
    Image1.src=grphcs[1]="http://www.jr-richscooterdoc.com/HW/skel2.gif"
    Image2=new Image();
    Image2.src=grphcs[2]="http://www.jr-richscooterdoc.com/HW/skel3.gif"
    Image3=new Image();
    Image3.src=grphcs[3]="http://www.jr-richscooterdoc.com/HW/skel4.gif"
    Image4=new Image();
    Image4.src=grphcs[4]="http://www.jr-richscooterdoc.com/HW/skel5.gif"
    Image5=new Image();
    Image5.src=grphcs[5]="http://www.jr-richscooterdoc.com/HW/skel6.gif"
    Image6=new Image();
    Image6.src=grphcs[6]="http://www.jr-richscooterdoc.com/HW/skel7.gif"
    with the informal declaration, 7 images, and the amount at 7 then all 7 images will load each time? But If I set the amount to say 4 then it would grab 4 images and it may reload a different set of 4 each time? If this is the case then one could store many images in their host and then put the link in to match what you want it to grab and control the number of images shown with the "amount number"

    That would be cool.

  4. #14
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,704
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    With this code it would just grab the first 4 each time. With the newer code in our other thread it it would grab 4 at random each time the page loads.
    - John
    ________________________

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

  5. #15
    Join Date
    Oct 2013
    Posts
    57
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    I understand Thanks.

Similar Threads

  1. Show/Hide code help
    By wakrah in forum JavaScript
    Replies: 3
    Last Post: 12-22-2009, 04:38 PM
  2. Thumb Pop images On mouse houre images code
    By sreenivasulareddy in forum JavaScript
    Replies: 0
    Last Post: 04-14-2008, 12:30 PM
  3. Flex-Slide Show Images Won't Show
    By stillatlarge in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 09-24-2006, 09:01 PM
  4. having problem with slide show code
    By ashbyfan in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 04-23-2006, 08:30 PM
  5. having problem with slide show code
    By ashbyfan in forum The lounge
    Replies: 1
    Last Post: 04-23-2006, 08:30 PM

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
  •