made by 8 Dimensions ©
This JavaScript mini library purpose is to allow easy adding of a slideshow feature to a web page. It’s enough to fill an array with pictures and call two methods.
Pic[0] =
['http://www.mysite.com/img01.jpg','#image1map',true];
Pic[1] = ['http://www. mysite.com/img02.jpg ','# image1map',true];
Pic[2] = ['http://www. yoursite.com/funny.jpg','# image2map',false];
Pic[3] = ['http://www. othersite.com/imges/cool.png', '',false];
Other variables are defined in the library. Their usage outside the library is not advised tough as it my compromise the correct behavior of the functions.
Paremeters:
The function's return value - in case of DOM supporting browsers - is the object of slide show it created. It's useful to set up some additonal object properties for example.
This function must be called in the <BODY> section of the page at the place where the slideshow is to be displayed.
Paremeters:
This function must be called at least once for the slideshow to work correctly. It is advisable to call it in the onLoad event of the page.
This function is to manually start the slideshow, for example as a reaction to mouse movement over some region or mouse click on some element of the page.
The slideshow continues from the image currently showing, if it is a member of the array. Otherwise the slideshow continues with the image following the last one shown from the array.
The functions purpose is opposite of the stopSlideShow’s one.
This function stops the slideshow, for example as a reaction to mouse movement over some region or mouse click on some element of the page.
The slideshow stops and the active image is made fully opaque if it’s not already.
The functions purpose is opposite of the runSlideShow’s one.
Paremeters:
This functions shows the image specified in parameters covered by attached map (if supplied). The slideshow is stopped by this function. If the image is a member of the Pic array once the slideshow is restarted (by the function runSlideShow) it continues from the next image in the array, otherwise from the image following the last shown from the array.
Paremeters:
This function shows the image from the Pic array identified by the parameter. The image is made fully opaque and the slideshow is stopped. If it’s rerun later on (using the function runSlideShow) it continues with the image following the one shown by this function.
This function has to be called if any changes made in the Pic array after the call of initSlideShow are to be registered. If the slideshow is active at the moment of refresh it's stopped and restarted after the refresh. The restart of the slideshow shows the first image in the Pic array.
There are other functions in the library with names starting with “_”. They are not intended to be called from outside the library.
<script type="text/javascript" language="JavaScript" src="Dim8_crfdsldeshow.js"></script>
<script type="text/javascript" language="JavaScript">
Pic[0] =
['http://www.mysite.com/img01.jpg','#image1map',true];
Pic[1] = ['http://www. mysite.com/img02.jpg ','# image1map',true];
Pic[2] = ['http://www. yoursite.com/funny.jpg','# image2map',false];
Pic[3] = ['http://www. othersite.com/imges/cool.png', '',false];
</script>
<p><script type="text/javascript" language="JavaScript">writeSlideShowCode(620,380,"black");</script></p>
<body ONLOAD="initSlideShow(-1,true)">
Unfortunately the script does not support more then one slideshow per page. To have more frames or iframes have to be used.
(no cross fade, direct change of images)
The compatibility with other browsers depend whether they support DOM and opacity.
1.0 | 26.I.2007 | The first version released |
1.1 | 01.II.2007 | fadebgcolor in writeSlideShowCode can be omitted now, no background then. The image is changed only when URL differs (better for IE behavior). |
1.2 | 15.II.2007 | writeSlideShowCode function now returns a reference to the object it created (in DOM browser), so its various properties can be set. |
The library was created by 8 Dimensions. Go to www.8dimensions.com to see more.
Big thanks goes to CodeLifter.com whose FadeIn_1_5 script was a big inspiration and source of ideas.