• 随机的背景图案


    <html>

    <head>
    <title>网页特效|Linkweb.cn/Js|---随机的背景图案</title>
    <meta content="text/html; charset=gb2312" http-equiv="Content-Type">
    <style type="text/css">BODY {
    FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
    }
    A {
    COLOR: #000000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: none
    }
    A:hover {
    COLOR: red; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: underline
    }
    A:visited {
    COLOR: darkblue; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
    }
    A:active {
    COLOR: cyan; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-WEIGHT: bold; TEXT-DECORATION: underline
    }
    TD {
    COLOR: #000000; FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; TEXT-DECORATION: none
    }
    BR {
    FONT-FAMILY: "宋体"; FONT-SIZE: 9pt
    }
    </style>
    <script language="JavaScript">
    bg = new Array(5);
    bg[0] = 'images/a.jpg'
    bg[1] = 'images/b.jpg'
    bg[2] = 'images/c.jpg'
    bg[3] = 'images/d.jpg'
    bg[4] = 'images/e.jpg'

    index = Math.floor(Math.random() * bg.length);
    document.write("<BODY BACKGROUND="+bg[index]+">");</script>

    </head>

    <body>

    <div align="center">
    <center>
    <table border="0" width="100%">
    <tr>
    <td width="41%"> </td>
    <td width="59%">&nbsp;&nbsp;&nbsp; <font size="6" color="#0000FF">背景随机显示</font><br>
    &nbsp;&nbsp; <font size="3">试着单击浏览器工具栏“刷新”按钮,是不是每次刷新后的页面背景都不一样,很有趣吧。其实现方法其实很简单,注意下面的代码:</font></td>
    </tr>
    <tr>
    <td width="41%"></td>
    <td width="59%"></td>
    </tr>
    </table>
    </center>
    </div>

    <p align="center"><br>
    &nbsp;</p>

    <p align="center"> </p>
    <div align="center"><center>

    <table border="0" cellPadding="0" cellSpacing="0" width="80%">
    <TBODY>
    <tr>
    <td width="100%">将如下代码加入HTML的&lt;HEAD&gt;区:<br>
    <br>
    &lt;script LANGUAGE=&quot;JavaScript&quot;&gt;<br>
    bg = new Array(<font color="#ff0000">2</font>); //设定图片数量,如果图片数为3,这个参数就设为2,依次类推<br>
    bg[0] = '<font color="#ff0000">bg1.gif</font>'&nbsp; //显示的图片路径,可用http://<br>
    bg[1] = '<font color="#ff0000">bg2.gif</font>'<br>
    bg[2] = '<font color="#ff0000">bg3.gif</font>'<br>
    index = Math.floor(Math.random() * bg.length);<br>
    document.write(&quot;&lt;BODY BACKGROUND=&quot;+bg[index]+&quot;&gt;&quot;);<br>
    &lt;/script&gt;</td>
    </tr>
    </TBODY>
    </table>
    </center></div>
    </body>
    </html>

  • 相关阅读:
    赫夫曼树编码
    根据先序和中序实现后序
    C++语言实现开心消消乐
    C语言风格实现的开心消消乐
    动态规划
    leetcode dp wordbreakII
    欧拉回路
    欧拉通路是否存在
    Python|多任务:线程、进程、协程--你想要的都在这里
    网络通信:socket、udp与tcp
  • 原文地址:https://www.cnblogs.com/surplus/p/12339847.html
Copyright © 2020-2023  润新知