No 9 · 图片轮换特效

<img alt="" src="face/face1.jpg" width="635" height="76" id="turn" 
style="filter:revealTrans(duration=1)" />
<script type="text/javascript">
    var obj, delay = 2000, number=2, url, file, suffix;
    function window.onload() {
        obj = document.getElementById("turn");    //捕获ID为turn的对象   
       
        setTimeout("change()", delay)       
        //delay/2毫秒后执行change()函数
    }
    function change() {
        with (obj.filters.revealTrans) {
            apply()              //捕获对象内容的初始显示,为转换做必要的准备           
            transition = 23
            file = "face/face";
            suffix = ".jpg";
            url = file + number + suffix; //设置图片的路径                               
            if (number == 1) {
                number = 2;
            }
            else {
                number = 1;
            }
            obj.src = url;
            play()                         //开始转换。
        }       
    }
</script>

你可能感兴趣的:(No 9 · 图片轮换特效)