随机变换背景图象

<Script Language=”JavaScript”>
image = new Array(4); //定义image为图片数量的数组
image [0] = ‘tu0.gif’ //背景图象的路径
image [1] = ‘tu1.gif’
image [2] = ‘tu2.gif’
image [3] = ‘tu3.gif’
image [4] = ‘tu4.gif’
number = Math.floor(Math.random() * image.length);
document.write(“<BODY BACKGROUND=”+image[number]+”>”);
</Script>

转载请注明出处:https://www.onexin.net/randomly-change-background-image/

随机文章:

1、[个人潜能10B]我给你的个人挑战
https://www.onexin.net/personal-power-10b-ill-give-you-a-personal-challenge/

2、PHP字符串处理的十个技巧
https://www.onexin.net/php-string-handling-of-the-10-methods/

3、SQL数据库结构合理设计
https://www.onexin.net/rational-design-of-sql-database-structure/

4、supesite远程图片本地化并作为文章附件
https://www.onexin.net/supesite-remote-image-localization-and-as-a-post-attachments/

5、中国天气数据php版
https://www.onexin.net/chinese-weather-data-in-php-version/

Leave a Reply