View Full Version : Fade-in slideshow start from other than first image

04-18-2013, 08:43 PM
1) Script Title: Ultimate Fade-in slideshow (v2.4)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: How is it possible to start the slideshow automatically when page is loading from another picture than the first one?
The scenario: I got a thumbnail gallery and want to start the slideshow with the correspondig slideshow image.
I know that a certain image can be startet with the nav buttons via extrabuttons.js but I don't know how to put the start number in the gallery options.
I tried to use an array with the desired image in first place, but then the status shows 1 of X instead of 5 of X when starting with the fifth image.

Note: the thumbnail gallery links to a pop-up window in which the Fade-in slideshow is working, so I need to put a url parameter into the options. It's not the same page!

Ist there an option giving a starting index?

04-18-2013, 09:50 PM
So you already know how to retrieve a URL parameter (this can be easily done server side, fairly easily with javascript alone) if you already know how to do that and just want somewhere to plug it into the script, we could add an option to the on page var mygallery=new fadeSlideShow init code:

startindex: 4, //Zero based starting index

Then, using a text only editor like NotePad, near the beginning of the fadesliseshow.js script, change the highlighted line as shown:

. . . peed: 200 //speed of description panel animation (in millisec)

//No need to edit beyond here...


function fadeSlideShow(settingarg){
var setting=this.setting
setting.fadeduration=setting.fadeduration? parseInt(setting.fadeduration) : 500
setting.curimage=(setting.persist)? fadeSlideShow.routines.getCookie("gallery-"+setting.wrapperid) : (setting.startindex || 0)
setting.curimage=setting.curimage || 0 //account for curimage being null if cookie is empty
setting.currentstep=0 //keep track of # of slides slideshow has gone through (applicable in displaymode='auto' only)
setting.totalsteps=setting.imagearray.length*( . . .

If you need help sending/retrieving the URL parameter, or have any other questions, just let me know.

04-18-2013, 10:32 PM
Thank you, John.

This works great. The url parameter is processed by a php script which is writing the whole code. The filenames are delivered by a database, so I just had to figure out the index of the actual picture. The filenames and the starting index (and dimension, speed etc.) are parsed into a template.
I think this is a useful new parameter.

(I'm familiar with html, php and mysql... but javascript is not my favorite :( )