The Ultimate fade-in script uses different arrays, configured at the beginning of the script. These arrays could all be defined there in one external version and then be called only on the pages where they are needed as the part of the script that goes in the body of the page is the part that determines which array is to be used.
Alternately, the script could be used externally with no arrays, then on each individual page where it is to be used, the array(s) for that page could be defined in a separate script, as long as that script was above the in body call for the script. Example script with array only:
Code:
<script type="text/javascript">
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
</script>
The array(s) for the page could also be defined in with the in body call for the script:
Code:
<script type="text/javascript">
var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["photo1.jpg", "", ""] //plain image syntax
fadeimages[1]=["photo2.jpg", "http://www.cssdrive.com", ""] //image with link syntax
fadeimages[2]=["photo3.jpg", "http://www.javascriptkit.com", "_new"] //image with link and target syntax
//new fadeshow(IMAGES_ARRAY_NAME, slideshow_width, slideshow_height, borderwidth, delay, pause (0=no, 1=yes), optionalRandomOrder)
new fadeshow(fadeimages, 140, 225, 0, 3000, 1, "R")
</script>
To answer your question about how much code must be included in a 'dummy' external script to avoid an error, none. If you have a call like this in the head:
<script type="text/javascript" src="dummy.js"></script>
and no file by the name of dummy.js exists, then there will be no error and, of course, it will have no effect on the page.
Bookmarks