• 网页浮动图片代码


    <div id="flash">
        <script type="text/javascript">
            var widths = 865;
            /*显示高度,自行调整*/
            var heights = 255;
            /*显示宽度,自行调整*/
            var counts = 5;
            img1 = new Image();
            img1.src = 'images/flash_07.jpg';
            img2 = new Image();
            img2.src = 'images/flash_071.jpg';
            img3 = new Image();
            img3.src = 'images/flash_072.jpg';
            img4 = new Image();
            img4.src = 'images/flash_073.jpg';
            img5 = new Image();
            img5.src = 'images/flash_074.jpg';
            //url1=new Image ();url1.src='';  //图片点击的网页链接
            //url2=new Image ();url2.src='';
            //url3=new Image ();url3.src='';  
            //url4=new Image ();url4.src=''; 
            //url5=new Image ();url5.src='';                                                   
            /* 建议将这块放置于JS中 下面的部分几乎是不需要任何改动*/
            var nn = 1;
            var key = 0;
            function change_img() {
                if (Sys.ie) {
                    document.getElementById("pic").filters[0].Apply();
                    document.getElementById("pic").filters[0].Play(duration = 2);
                    //}
                    eval('document.getElementById("pic").src=img' + nn + '.src');
                    //eval('document.getElementById("url").href=url'+nn+'.src');
                    nn++;
                    if (nn > counts) {
                        nn = 1;
                    }
                    tt = setTimeout('change_img()', 7000);
                } else {
                    if (key == 0) {
                        key = 1;
                    } else if (document.all) {
                        document.getElementById("pic").filters[0].Apply();
                        document.getElementById("pic").filters[0].Play(duration = 2);
                    }
                    eval('document.getElementById("pic").src=img' + nn + '.src');
                    //eval('document.getElementById("url").href=url'+nn+'.src');
                    nn++;
                    if (nn > counts) {
                        nn = 1;
                    }
                    tt = setTimeout('change_img()', 7000);
                }
    
            }
            //function changeimg(n){nn=n;window.clearInterval(tt);change_img();}
            document.write('<div><a id="url" ><img id="pic" style="border:0px; filter:progid:dximagetransform.microsoft.wipe(gradientsize=2.0,wipestyle=4, motion=forward)" width=' + widths + ' height=' + heights + ' /></a></div>');
    
            //for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}
            change_img();
        </script>
    </div>
    
  • 相关阅读:
    苹果 iOS 8 新固件新功能特性总结汇总 (苹果 iPhone/iPad 最新移动操作系统)
    为什么魔兽世界里男性玩家爱选女性角色?
    腾讯PK微软 王者之战一触即发
    策略模式
    代理模式
    模板模式
    适配器模式
    工厂模式
    随机森林步骤(转)
    马氏距离通俗理解(转)
  • 原文地址:https://www.cnblogs.com/zxlovenet/p/2827843.html
Copyright © 2020-2023  润新知