Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    NGC
    NGC is offline
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question @ Javascript image slider

    Hey guys,

    I'm trying to make a simple mod to an existing JS image slider, but after fooling around with it for a couple hours now, I can't seem to figure out how to do it. This is the script I'm working with...

    http://www.dynamicdrive.com/dynamici...nslideshow.htm

    Basically, I'd like to be able to specify how long *each* image is displayed (instead of just having a single display time for all images).

    The existing display time (for all images) is located in the 'HEAD' section of the code (it's called 'pause').

    Does anyone know how I can accomplish this?

    FYI, I'm pretty comfortable with HTML/CSS, but I'm basically a newb when it comes to Javascript, so please keep that in mind when replying.

    Thanks!

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    This is not really simple. You'll have to do (at least) the following:

    - add another value to the imagearray option with the index [4]. This will be the duration (integer)
    - remove the fadeduration option
    - remove this line from the plug-in
    Code:
    setting.fadeduration=setting.fadeduration? parseInt(setting.fadeduration) : 500
    - replace the following line
    Code:
    .stop().css({opacity:0}).animate({opacity:1}, setting.fadeduration, function(){ //Callback function after fade animation is complete:
    with
    Code:
    .stop().css({opacity:0}).animate({opacity:1}, setting.imagearray[imgindex][4], function(){ //Callback function after fade animation is complete:

  • Users who have thanked devnull69 for this post:

    NGC (06-21-2012)

  • #3
    NGC
    NGC is offline
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks devnull69. I tried implementing your code, but I'm afraid I don't know enough about JS to get it to work. Thanks anyways.

  • #4
    New Coder
    Join Date
    May 2012
    Posts
    25
    Thanks
    0
    Thanked 1 Time in 1 Post
    Why not try implementing awesome jcarousel with auto scroll options

    see this post here


  •  

    Posting Permissions

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