PDA

View Full Version : Swiss Army Image Slideshow



DaveX
04-04-2007, 02:36 AM
1) Script Title: Swiss Army Image Slideshow

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

3) Describe problem: I'm not quite clear how to use the variable settings in the code. For instance, I'm using the first slideshow and I want to change the time interval and take out the text description as well. I've played around with it a bit but I'm not getting the correct results.

jscheuer1
04-04-2007, 04:51 AM
First of all, don't set any properties for things where the default values will do. To specifically set the time interval set the:

slides.delay=3000;

to however many milliseconds that you like. To ditch the descriptions:

slides.no_descriptions=1;

These both must be defined after the array that will use them and set as properties of the array:


var slides=[]; //FIRST SLIDESHOW
//configure the below images and descriptions to your own.
slides[0] = ["photo1.jpg", ""];
slides[1] = ["photo2.jpg", ""];
slides[2] = ["photo3.jpg", ""];
slides[3] = ["photo4.jpg", ""];
slides[4] = ["photo5.jpg", ""];
slides.delay=3000;
slides.no_descriptions=1;


Also, even if using no descriptions, there still must be the empty quotes in each array entry as shown above.

DaveX
04-06-2007, 02:54 PM
If I want to change the buttons on this, can I simply make some up, name them left, stop, play and right.gif and put them into the root where the script is?

jscheuer1
04-06-2007, 05:05 PM
No, they go in the folder of the page that is using them* and the array's image_controls=1 property must be set:


var slides=[]; //FIRST SLIDESHOW
//configure the below images and descriptions to your own.
slides[0] = ["photo1.jpg", ""];
slides[1] = ["photo2.jpg", ""];
slides[2] = ["photo3.jpg", ""];
slides[3] = ["photo4.jpg", ""];
slides[4] = ["photo5.jpg", ""];
slides.delay=3000;
slides.no_descriptions=1;
slides.image_controls=1;

And, the script's global (from the demo):


//If using image buttons as controls, Set image buttons' image preload here true
//(use false for no preloading and for when using no image buttons as controls):
var preload_ctrl_images=true;

must be set to true as shown.


*Note: The image files can go anywhere but, if they are not in the same folder as the page that is using them, configure their absolute paths here (from the demo, added example absolute paths shown in dark red):


//And configure the image buttons' images here:
var previmg='http://www.somedomain.com/images/left.gif';
var stopimg='http://www.somedomain.com/images/stop.gif';
var playimg='http://www.somedomain.com/images/play.gif';
var nextimg='http://www.somedomain.com/images/right.gif';

DaveX
04-07-2007, 01:48 AM
That seems to have done the trick! 2 questions: How can I get rid of the yellow highlight on mouseover and, also, I made buttons but it seems to be blowing them up a bit. Or is it just me? Thanks for all the help! I'm almost there!

jscheuer1
04-07-2007, 03:38 AM
I could go on answering each question as you come to it and I will answer this one (as best I can) but first, there is a pattern emerging in many of your questions -


You want something done that is controlled by a property of the array.

I look up the property in the list on the demo page under the heading 'Configuration Options' and then tell you to assign it to the array.


The same is true here with the highlight color you are asking about, it is:


button_highlight='#cccccc' - onmouseover background-color for image buttons (string) (requires image_controls=1) - use color name or hex value with # prefix

Which you apply to the array like the others:


var slides=[]; //FIRST SLIDESHOW
//configure the below images and descriptions to your own.
slides[0] = ["photo1.jpg", ""];
slides[1] = ["photo2.jpg", ""];
slides[2] = ["photo3.jpg", ""];
slides[3] = ["photo4.jpg", ""];
slides[4] = ["photo5.jpg", ""];
slides.delay=3000;
slides.no_descriptions=1;
slides.image_controls=1;
slides.button_highlight='#cccccc';

I hope you see the same pattern emerging here that I do and may therefore be able to do some of these configurations yourself in the future*.

About the button images being a different size than you are expecting, if you aren't even sure that they are getting 'blown up', they may not be. I would need a link to your live page to tell.


*Give a man a fish and he will eat for a day. Teach a man to fish and he will spend all his time down at the dock drinking beer. :)

DaveX
04-07-2007, 02:12 PM
Aaargh! I feel, er, embarrassed... I see you've been referring me to the configuration options over and over. You were also kind enough to insert the code examples and I was thinking those were the options. I KNEW, way back in my head, that there was a table but I wasn't making the connection. Too many scripts and forums lately have left me in a bit of a twist. At any rate, thanks for all of your help and especially your patience! I HAVE learned a ton of stuff in the last few weeks hear and doing it in real practice is certainly the best way for me to figure this stuff out. I apologize for my sudden case of brain freeze and, again, you help is deeply appreciated!