HTML中的代码如下 
问题:我用一个按钮,点击可以在两张图片之间切换,可是它会用同一种切换方式切换,只有刷新一次页面才会换一次切换方式。不知道问题出在哪里。有哪个用过的,帮忙解决一下谢谢。小弟对满意答案的给分率是百分百。先谢谢了 <!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 runat="server"> 
    <title>无标题页 </title>     <script type="text/javascript"> 
    var isT=true; 
    function c() 
    { 
        var img1=document.getElementById("img1"); 
        
        if(isT) 
        { 
            img1.filters[0].Apply();                  
            img1.src="images/gallery_thum15.jpg"; 
            img1.filters[0].Play(); 
            isT=false; 
        } 
        else 
        { 
            img1.filters[0].Apply();                  
            img1.src="images/gallery_thum14.jpg"; 
            img1.filters[0].Play(); 
            isT=true; 
        } 
        
    } 
    </script>     <style type="text/css"> 
        #img1 
        { 
            width: 320px; 
            height: 320px; 
            filter: revealTrans(Transition=23,Duration=3.3); 
        } 
    </style> 
    <style type="text/css"> 
        #img1 
        { 
            height: 261px; 
            width: 243px; 
        } 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <div> 
        <img id="img1" alt="" src="images/gallery_thum14.jpg" /> 
    </div> 
    <input id="Button1" type="button" value="button" onclick="c()" /> 
    </form> 
</body> 
</html> 

解决方案 »

  1.   

    http://blog.csdn.net/diandian82/archive/2007/02/06/1503455.aspx
      

  2.   

    JavaScript 图片变换效果
      

  3.   

    解决:<!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 runat="server"> 
        <title>无标题页 </title>     <script type="text/javascript"> 
        var isT=true; 
        function c() 
        { 
            var img1=document.getElementById("img1"); 
            
            if(isT) 
            { img1.filters[0].transition = 23;

                img1.filters[0].Apply();                  
                img1.src="1259646401685.gif"; 
                img1.filters[0].Play(); 
                isT=false; 
            } 
            else 
            { img1.filters[0].transition = 23;
                img1.filters[0].Apply();                  
                img1.src="dongtai.jpg"; 
                img1.filters[0].Play(); 
                isT=true; 
            } 
            
        } 
        </script>     <style type="text/css"> 
            #img1 
            { 
                width: 320px; 
                height: 320px; 
                filter: revealTrans(Transition=23,Duration=3.3); 
            } 
        </style> 
        <style type="text/css"> 
            #img1 
            { 
                height: 261px; 
                width: 243px; 
            } 
        </style> 
    </head> 
    <body> 
        <form id="form1" runat="server"> 
        <div><img id="img1"   alt="" src="dongtai.jpg" /></div> 
        <input id="Button1" type="button" value="button" onclick="c()" /> 
        </form> 
    </body> 
    </html> 
      

  4.   

    谢谢各位的解答了。特别是四楼。
    因为他的一句代码解决了。。3Q3Q3Q