Fading slideshow are the slideshow that use fade-in and fade-out as slide transitional effect. All fading slideshow script I can find on Internet has two problems in common.
The method introduced in this article solves both problems. You can see it in action (you need to wait 10 seconds to see first transition) and try play with it by turnning off javascript. You can download the javascript and use it on your own as I put it in public domain.
To be able to fall back when javascript / flash is disabled,
the slide should be using meta-refresh feature, which reloads the whole HTML
document, and be embeded in an <object> tag so the parent
containing frame is not reloaded. Upon every reload, the server side should
generate corresponding meta-refresh URI that points to the next slide.
When javascript is activated, javascript takes the role of
meta-refresh, thus meta-refresh must be enclosed in
<noscript>, as following:
<noscript>
<meta http-equiv="refresh" content="3;url=?*" />
</noscript>
And then the javascript in page-transition.js loads the page specified in
meta-refresh using XMLHttpRequest, parse the returned HTML
document, find out the next slide's URI and slide interval, and replace the
content of the current HTML page with the newly requested page, using fade-in
effect. This process goes on forever until user leaves the page.
I use SSI (server side inclusion) for my website. Doing loop in SSI is a bit trickly. Since it doesn't have arithmatic data types like "integer", loop count has to be done by concatenating text strings, which differ from other programming language where arithmatic increase is used. The server side code are 5 lines like the following:
<!--#if expr='"$QUERY_STRING" = "****"'--> <!--#set var="next" value="*"--> <!--#else--> <!--#set var="next" value="$QUERY_STRING*"--> <!--#endif--> <noscript> <meta http-equiv="refresh" content="10;url=?<!--#echo var="next"-->"/> </noscript>
Every time a page reloads, the query string is padded with a single asterisk. Our slide have 4 pages, thus the SSI script replace quadrupal **** with single * when the script sees it.
Please kindly feedback your comments on this method or let me know more information, e.g. if other sites offered methods that achieve same or better effect.
Thank my colleague Wang Congming who finished the half-done script I passed, and thank him for forgiving my usual and tried-to-avoid ignorance and irresponsibility for starting a script and leaving to colleage to finish.