Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-21-2012, 12:18 AM   PM User | #1
NGC
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
NGC is an unknown quantity at this point
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!
NGC is offline   Reply With Quote
Old 06-21-2012, 09:03 AM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 530 Times in 524 Posts
devnull69 will become famous soon enough
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:
devnull69 is offline   Reply With Quote
Users who have thanked devnull69 for this post:
NGC (06-21-2012)
Old 06-21-2012, 07:47 PM   PM User | #3
NGC
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
NGC is an unknown quantity at this point
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.
NGC is offline   Reply With Quote
Old 06-21-2012, 08:29 PM   PM User | #4
sayannayas
New Coder

 
Join Date: May 2012
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
sayannayas is an unknown quantity at this point
Why not try implementing awesome jcarousel with auto scroll options

see this post here
sayannayas is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:43 PM.


Advertisement
Log in to turn off these ads.