Happy New Year! I've set up a demo. It uses the cmotion script almost 'as is' except you no longer need the enlargeimage() function. Also, the HTML portion is now mostly generated by an on page script. This is the last script on the page. I have actually doubled a portion of it (as noted by comments) to make for a longer image train, just for demonstration purposes. The rest of the additions are another script that I have documented fairly well on the page. If you have any questions, let me know.
Notes: This is on a slow server so load times will generally be faster than encountered with this demo, at least for a comparable number of similarly sized images. To help the browser load things more quickly, it would be a good idea to include width and height in (as added in red below):
Code:
document.write('<a href="javascript:switchFade('+[i_tem]+', dynimages)"><img src="'+dynimages[i_tem][0]+'" width="70" height="113" border="1"></a>')
this otherwise exact copy of a line near the end of the page. This will only work if all the thumbnails (which are the images for the cmotion part) are of the same dimensions. If not, you can do without it or replace the document write statements with the original type of statement from cmotion -
Replace this sort of thing:
Code:
<script type="text/javascript">
document.write('<nobr id="trueContainer">')
for (var i_tem = 0; i_tem < dynimages.length; i_tem++)
document.write('<a href="javascript:switchFade('+[i_tem]+', dynimages)"><img src="'+dynimages[i_tem][0]+'" border="1"></a>')
document.write('</nobr>')
</script>
with this sort of thing but using the switchFade() function instead of the enlargeimage() function and include each individual thumnail's dimensions in the image tags:
HTML Code:
<nobr id="trueContainer"><a href="javascript:switchFade(0, dynimages)"><img src="photo1_thumb.jpg" border=1></a> <a href="javascript:switchFade(1, dynimages)"><img src="photo2_thumb.jpg" border=1></a> <a href="javascript:switchFade(2, dynimages)"><img src="photo3_thumb.jpg" border=1></a> <a href="javascript:switchFade(3, dynimages)"><img src="photo4_thumb.jpg" border=1></a> <a href="javascript:switchFade(4, dynimages)"><img src="photo5_thumb.jpg" border=1></a> <a href="javascript:switchFade(5, dynimages)"><img src="photo6_thumb.jpg" border=1></a> <a href="javascript:switchFade(6, dynimages)"><img src="photo7_thumb.jpg" border=1></a> <a href="javascript:switchFade(7, dynimages)"><img src="photo8_thumb.jpg" border=1></a> <a href="javascript:switchFade(8, dynimages)"><img src="photo9_thumb.jpg" border=1></a></nobr>
Bookmarks