ie的css滤镜可以做,不过别的浏览器看不到~~`图片播放器一般用flash做,js做浪费时间~而且没过渡效果~~

解决方案 »

  1.   

    <html>
    <style>
    </style>
    <script>
    window.onload=initPicPlayer;
    function initPicPlayer(){
            var urls=["01.jpg","02.jpg","03.jpg","04.jpg"];
            var tag=document.getElementById("player");
            window.player=new picPlayer(tag,urls);
            window.player.start();
    }
    function picPlayer(img,urls){
        this.urls=urls;
        this.tag=img;
        this.tag.src=this.urls[0];
        this.next=1;
        this.start=function(){
            this.timer=window.setInterval("window.player.change()",3000);
        }
        this.stop=function(){
            clearInterval(this.timer);
        }
        this.change=function(){
            this.tag.src=this.urls[this.next%this.urls.length];
            this.next++;
        }
    }
    function control(btn){
        if(btn.value=="Stop"){
            btn.value="Play";
            window.player.stop();
        }else{
            btn.value="Stop";
            window.player.start();
        }
    }
    </script>
    <body>
    <img id="player" />
    <input type="button" value="Stop" onclick="control(this)" />
    </body>
    </html>