• 网页浮动图片代码


    <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>
    
  • 相关阅读:
    JAVA中HashMap相关知识的总结(一)
    linux进阶之路(三):vi/vim编辑器
    linux进阶之路(二):linux文件目录
    linux进阶之路(一):linux入门
    linux:lrzsz安装
    一:阿里云服务器使用及后台环境搭建
    第二篇:线程七种状态
    Git log
    redis3.0 集群实战3
    详解Linux chgrp和chown命令的用法
  • 原文地址:https://www.cnblogs.com/zxlovenet/p/2827843.html
Copyright © 2020-2023  润新知