PDA

View Full Version : Resolved Ultimate Fade-in slideshow show up after I refresh the browser.



dogshasha
02-25-2009, 08:11 PM
1) Script Title: Ultimate Fade-in slideshow

2) Script URL (on DD):http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem: I'm trying to let javascript parse the images and assign image's width and height on the runtime. But the slideshow doesn't display the first time until I refresh the page.

<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="" summary=""><tr>
<td align="Center" width="100%">

<script type="text/javascript">
var bannerImgFile="/images/logo_lft1.jpg;/images/logo_lft2.jpg;/images/logo_lft3.jpg";
var rotateBanner = new Array();

var imgArray=bannerImgFile.split(";");
for (i=0;i<imgArray.length;i++) {
rotateBanner[i] = [imgArray[i],"",""];
}

for(i=0;i<rotateBanner.length;i++){
rotateBanner[i][1] = '';
}
var fadebgcolor="white";

var image_1=new Image();
image_1.src=imgArray[0];
var rotateBanner_width=image_1.width;
var rotateBanner_height=image_1.height;
</script>

<script type="text/javascript">new fadeshow(rotateBanner, rotateBanner_width, rotateBanner_height, 0, 3000, 1, 0)</script>

</td></tr></table>

jscheuer1
02-26-2009, 01:53 AM
The Swiss Army Image slideshow:

http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm

which can be configured to look just like Ultimate Fade if you like, already does (if I understand you correctly) something like that.

What Swiss does, if you specify no width and height for the show(s) you setup with it is to preload each image and set the width and height based on the first image. Alternatively you can configure its width and height to the width of the widest image and to the height of the tallest image, it will then center each image within a box of those dimensions.