Results 1 to 3 of 3

Thread: How to get image slider to stop after last image

  1. #1
    Join Date
    Feb 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to get image slider to stop after last image

    H, noob here

    I am trying to get this image slider to stop after the last image is reached and still display that image so
    that a user will have to hit the back button to move backwards again through the images until the first
    one is reached again.

    The way it works now, when the last image is reached, the next click forward moves the whole display upwards
    with no image and I would rather it just can't move past the last image, except to move backwards again.

    It is this dynamicdrive script http://www.dynamicdrive.com/dynamici...dhtmlslide.htm
    Last edited by jscheuer1; 02-21-2016 at 04:07 PM. Reason: fix broken link

  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

    NOTE: The link in the above post was not to any script. I assumed you meant the one from your other post, which was essentially a duplicate of this post, but in the wrong section. If you have another script in mind, let us know.


    This is an old script. I see it uses hash tag links as controls. Those can make a page jump to the top, but since the onclick event returns false, that shouldn't, and in fact doesn't happen for me. Some browsers might think though, once you're at the end, the return value is determined by something else. What browser and device are you using? Have you changed anything? If it is the hash tag link that's causing this, you can get rid of those. Where it has:

    Code:
      <tr>
        <td width="50%" height="21"><p align="left"><a href="#" onClick="backward();return false">Previous Slide</a></td>
        <td width="50%" height="21"><p align="right"><a href="#" onClick="forward();return false">Next Slide</a></td>
      </tr>
    Change that to:

    Code:
      <tr>
        <td width="50%" height="21"><p align="left"><span style="cursor: pointer; color: navy;" onclick="backward();">Previous Slide</span></td>
        <td width="50%" height="21"><p align="right"><span style="cursor: pointer; color: navy;" onclick="forward();">Next Slide</span></td>
      </tr>
    If you want more help, please answer the browser/device questions and post a link to the page on your site that contains the problematic code, so we can check it out.
    Last edited by jscheuer1; 02-21-2016 at 04:37 PM. Reason: sense
    - John
    ________________________

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

  3. #3
    Join Date
    Feb 2016
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    John, thanks for the help! I deleted the script and then copied it again and this time it works, so somehow the first time I must have not copied it incorrectly and left something out.
    Now that it works, I will copy your above script to see what it does just for fun as I need to learn more about all this. Thanks again for taking the time to reply.

Similar Threads

  1. Go thru images once and stop on last image, without repeating first image...
    By mail@vinceg.com in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 08-03-2015, 06:39 PM
  2. Resolved Stop blinking image when new image is loaded
    By theremotedr in forum JavaScript
    Replies: 5
    Last Post: 05-19-2015, 11:11 PM
  3. Featured Content Slider. Youtube video donīt stop when slider changes
    By Vlack in forum Dynamic Drive scripts help
    Replies: 7
    Last Post: 06-15-2011, 09:54 AM
  4. jQuery image slider with image counter
    By bigalo in forum Looking for such a script or service
    Replies: 2
    Last Post: 12-10-2009, 04:13 PM
  5. Blending Image Slideshow Script stop on last image
    By zot in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 07-18-2007, 10:31 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
  •