<%@ page language="java" pageEncoding="utf-8"%>
<!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>简单高效的javascript 幻灯片播放</title>
</head>
<body>
<div>
<div id="divs">
<img  src="jpg/1.jpg" id="1"  style="FILTER: revealTrans(duration=2,transition=16); cursor:pointer;" onclick="location.href = 'http://www.163.com'">
<img  src="jpg/2.jpg" id="2"   style="FILTER: revealTrans(duration=2,transition=17);  cursor:pointer;display:none" onclick="location.href = 'http://www.sina.com.cn'">
<img  src="jpg/3.jpg" id="3"   style="FILTER: revealTrans(duration=2,transition=18);  cursor:pointer;display:none" onclick="location.href = 'http://www.codefans.net'">
<img  src="jpg/1.jpg" id="4"   style="FILTER: revealTrans(duration=2,transition=19);  cursor:pointer;display:none" onclick="location.href = 'http://www.qq.com'">
<img  src="jpg/1.jpg" id="5"   style="FILTER: revealTrans(duration=2,transition=20);  cursor:pointer;display:none" onclick="location.href = 'http://www.google.com'">
<img  src="jpg/1.jpg" id="6"   style="FILTER: revealTrans(duration=2,transition=21);  cursor:pointer;display:none" onclick="location.href = 'http://www.baidu.com'">
</div>
<script language="javascript">
function $(_sId) {
    return document.getElementById(_sId);
}
var speed=3000;
var setid=null; 
var auto="true";
function galleryplay(divs,a,mtime){ //t为要应用此函数的id,a初始化时显示的项目的顺序数 
    if(divs=="0")return false;    
    var start=3;
    if(auto=="true")
    {
        start = a-1;//初始项目 
        speed = mtime;//切换间隔 
        setid = null;//定时器     
        var loop = function(){ //自动切换         
            ids = divs.split(",");                        
            for (var i=0;i<ids.length; i++)
            {            
                 $(ids[i]).style.display='none';
            
            }                                    
            $(ids[start]).filters.revealTrans.Transition = Math.floor(Math.random() * 23);
            $(ids[start]).filters.revealTrans.apply();
            $(ids[start]).filters.revealTrans.play();
            $(ids[start]).style.display='';
            
            setid=setTimeout(loop,speed); 
            start++; 
            if(start==ids.length){ 
                start=0;                  
            } 
        };loop();     
    }
}
galleryplay('1,2,3,4,5,6',1,3000);
</script>
</div>
</body>
</html>

解决方案 »

  1.   

    1,非IE浏览器都不支持滤镜
    2,看看图片格式在photoshop里面的模式是否是RGB格式的,不能说CMYK格式的
      

  2.   

    Filter只有IE支持这个属性,
    楼主的问题更像是CSS兼容问题
    楼主加上
    <meta http-equiv="page-enter" content="revealtrans(duration=3,transition=23)">
    <meta http-equiv="page-exit" content="revealtrans(duration=3,transition=23)">
    这个试试
      

  3.   

    这个也不是啊还是不好用   那我不好改了吗
    还有想问一下  我用dreamweaver建了个jsp然后画了表格什么的,之后把代码粘到有strus的jsp页面不好用是怎么回事。
      

  4.   

    谢谢你 
    那就是说这段代码 在chrome下是不能用的吗
      

  5.   

    非IE内核的浏览器都不能用把代码粘到有strus的jsp页面不好用是怎么回事
    应该是没有符合struts的标签语法,或者没有数据传进来
      

  6.   

    是这样的,当页面有struts标签语法的时候,我原本的一个幻灯片不能播放,图片不显示,就显示一条,然后本来的form表单也消失了,当我删了标签语法都好了。这是怎么回事,但是删了标签语法,html:form也不能用啊