| 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 |


Vielen Dank
The client side JavaScript does not know anything about the server side PHP, it not even knows that the page it resides in is not a static page so - a conflict is rather unlikely. A lot more probable is a mistake/misconfiguration. If you could provide a link to the page I will have a look at it.
Best regards
Andreas
Hast Du schon mal in Erwägung gezogen, dass es an den Änderungen liegen könnte, die Du am Script vorgenommen hast? Falls nicht, es wäre vielleicht einen Versuch wert, das Script im Original zu verwenden und zu sehen, was passiert.
Gruß
Andreas
Kann es sein, dass es an was anderem liegt?
Das passiert, wenn man keine Hintergrundfarbe (var def_backgr="#eeeeee";) gesetzt hat :)
Gruß
Andreas
der Link zur Seite lautet filary.de
Da müsstest du vielleicht bisschen warten, bis mal ein Bild kommt, welches breiter oder höher ist, als das andere :)
Dann solltest du erkennen, was ich meinte :)
Danke schonmals,
Ninos
Um herauszufinden, ob die Slideshow funktioniert - müssten Sie sie verwenden :)
Auf der Seite Slideshow (im Menü links) kann man das Script herunterladen (bretteleben.de.slideshow.20090406.zip). Das Archiv enthält ein voll funktionsfähiges Beispiel. Unter anderem enthält es die Datei be_slide.js. Das ist das Script. Es beginnt mit dem Copyright, dann folgen die Parameter, dann das eigentliche Script. Sie haben auf Ihrer Seite lediglich den Block mit den Parametern eingebaut, das ist ein bisschen zu wenig.
Verwenden Sie das ganze Script - und die Sache wird besser laufen. Der Iframe ist übrigens nicht nötig.
Gruß
Andreas
http://www.gv-fehraltorf.ch/expo_8320/
Wäre der inline-Frame überhaupt nötig oder kann ich den DIV-Container direkt in die Tabellenzelle setzen?
Es wäre schade, wenn ich es nicht zum Laufen bekäme; besonders der Start mit Zufallsbild ist mir wichtig.
Danke für die Hilfe
Caroline