...

View Full Version : Question @ Javascript image slider



NGC
06-21-2012, 01:18 AM
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/dynamicindex14/fadeinslideshow.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!

devnull69
06-21-2012, 10:03 AM
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


setting.fadeduration=setting.fadeduration? parseInt(setting.fadeduration) : 500

- replace the following line


.stop().css({opacity:0}).animate({opacity:1}, setting.fadeduration, function(){ //Callback function after fade animation is complete:

with


.stop().css({opacity:0}).animate({opacity:1}, setting.imagearray[imgindex][4], function(){ //Callback function after fade animation is complete:

NGC
06-21-2012, 08:47 PM
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.

sayannayas
06-21-2012, 09:29 PM
Why not try implementing awesome jcarousel with auto scroll options

see this post here (http://fundapass.blogspot.in/2012/05/hello-syntaxhighlighter-function.html)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum