不错的JS图片渐变效果:

本效果只支持IE, 在FIRFOX下面看不到渐变效果, 但是可以看到图片跳动变换的效果.

<!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=gb2312″ />
<title>无标题文档</title>
<script>
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;

// Duration of crossfade (seconds)
var crossFadeDuration = 3;

// Specify the image files

var Pic = new Array(); // don’t touch this
var PicUrl = new Array(); // don’t touch this

var PicCaption = new Array(); // don’t touch this

Pic[0] = ‘userfiles/img2.jpg’;
Pic[1] = ‘../images/img3.jpg’;
Pic[2] = ‘../images/img4.jpg’;

PicUrl[0] = ‘#’;
PicUrl[1] = ‘#’;

var PageNav=’#’;

// =======================================
// do not edit anything below this line
// =======================================

var m_intTimeOut;
var j = 0;
var m_intArrayLen = Pic.length;

var preLoad = new Array();
for (i = 0; i < m_intArrayLen; i++)
{
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter=”blendTrans(duration=2)”;
      document.images.SlideShow.style.filter=”blendTrans(duration=crossFadeDuration)”;
      document.images.SlideShow.filters.blendTrans.Apply();     
   }
   document.images.SlideShow.src = preLoad[j].src;
 PageNav=PicUrl[j];

   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (m_intArrayLen-1)) j=0
   m_intTimeOut = setTimeout(‘runSlideShow()’, slideShowSpeed);
}

function pg_nav()
{
 window.location.href=PageNav;
}
</script>
</head>

<body onLoad=”runSlideShow()”>
<img src=”userfiles/1.jpg” width=”913″ height=”314″ name=”SlideShow”>
</body>
</html>


寒林

www.3code.cn 专注WordPress企业主题