| JavaScript: Slideshow Sample01 |
| Written by Andreas Berger |
| Sunday, 01 March 2009 12:28 |
|
The first sample shows the standard configuration of the script. The starting basis: 1 page with 1 slideshow. The file names "be_slide.html" and "be_slide.js" correspond with the file names in the sample that comes with the download of the script at JavaScript: slideshow. The following explanatory notes also refer to these files and show how to integrate the script from the HTML-page and set the parameters in the downloaded JavaScript be_slide.js. be_slide.html - the webpageThe first step is to integrate the script into the webpage. To achieve this, it is linked from the HEAD-section of the page:<script type="text/javascript" src="be_slide.js"></script> The sample assumes, that the script is located in the same directory as the webpage, otherwise the path has to be adjusted. <div id="slideshow" style="margin:25px;"> <img src="pics/pic01a.jpg" style="width:400px;height:300px;" /> </div> That´s it for the webpage. be_slide.js - the scriptfileNow we set the parameters in the scriptfile be_slide.js to fit our needs. The sample above uses the following values:
//*****parameters to set***** var def_imges=new Array ('pics/pic01a.jpg', 'pics/pic01b.jpg', 'pics/pic01c.jpg'); //In this array, set the pictures you want the slideshow to display. var def_divid="slideshow"; //The IDENTITY of the DIV-Containers, //we created to hold the slideshow var def_picwid=400; //The width of the widest picture in pixel. //Notice: The script does not scale your pictures! var def_pichei=300; //The height of the highest picture in pixel. //Notice: The script does not scale your pictures! var def_backgr="#eeeeee"; //The background-color of the slideshow. It is of importance //if you have pictures in your set, that do not fit the values //set above for width and height. var def_sdur=3; //The time, a picture is shown between two transitions in seconds. var def_fdur=1; //The time the transition should take var def_steps=20; //The number of steps to blend from 0-100. //A value between 1-100, the higher the value // the smoother the transition. var def_startwhen="y"; //Should the slideshow start automatically? //"y" for Yes, "n" for No var def_shuffle="y"; //Should we start with a random picture? //"y" for Yes, "n" for No var def_showcontr="y"; //Should we show control-elements? //"y" for Yes, "n" for No var def_contr=new Array('bwd.png','start.png','stop.png','fwd.png'); //if you show control elements, you may choose between textlinks //and buttons. Into this array therefor insert either the text //you want to be displayed or the path to the image you want to //be used. If the script finds either .jpg or .gif or .png as the //ending of your input, it will display the image automatically. //The sort order of the elements displayed and therefor within this //array is: BACK - START - STOP - FWD //****************************************************************
That´s it, have fun with the script! |
| Last Updated on Thursday, 26 November 2009 18:49 |


Im korrespondierenden Joomla-Plugin habe ich das bereits eingebaut. Es auf das Original rückzuportieren steht noch an.
Gruß
Andreas
Frage: Gibt es auch die Möglichkeit, die einzelnen Bilder innerhalb der Slideshow anzuklicken und somit einen (für jedes Bild unterschiedlichen) externen oder internen Link zu öffnen?
Grüße,
Silvia
Either provide a link or (if testing offline) zip the page (with all additional files) and send it per mail. I will have a look at it.
Kind regards
Andreas
Per
gruss, michael.
One general tip: Use Firefox to debug pages, it comes with an excellent Error Console.
About your current problem: You may want to either provide a link to a test-page or zip it and send it per mail. I will have a look at it.
Kind regards
Andreas
Ich berechne nichts für das Script.
Es ist unter der GNU GPL, der GNU General Public License lizensiert und das bedeutet, dass an die Verwendung und die Weitergabe bestimmte Bedingungen geknüpft sind.
Welche, das kann in der Lizenz unter (www.gnu.org/copyleft/gpl.html) nachgelesen werden. Es finden sich dort auch (unauthorisierte) Übersetzungen.
Gruß
Andreas