Solved

slideshow javascript - fade not working in chrome

Posted on 2012-03-10
3
1,066 Views
Last Modified: 2012-03-13
the following slideshow works in all browsers as far as switching images,
but it is supposed to have a fade from image to image.

it works in IE8, but not Chrome, Safari, Opera, FireFox

anyone know how to fix that?

thanks

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>slideshow</title>

<SCRIPT LANGUAGE="JavaScript">
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 7000;
// Duration of crossfade (seconds)
var crossFadeDuration = 5000;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'gallery/test1.jpeg'
Pic[1] = 'gallery/test2.jpeg'
Pic[2] = 'gallery/test3.jpeg'
Pic[3] = 'gallery/test4.jpeg'

// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=100)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}
</script>

</head>

<body onLoad="runSlideShow()">

<img src="gallery/test1.jpeg" name='SlideShow'/>


</body>

</html>

Open in new window

0
Comment
Question by:webdott
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 37706327
As far as I can tell, 'filter' is an IE only property.  Most slideshows use jQuery to create transitions in slideshows.  A lot of people use this one: http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
0
 

Author Closing Comment

by:webdott
ID: 37714871
thanks. that works for what i need.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 37716051
You're welcome.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now