随机变换背景图象

<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>

随机文章:

1、用户体验:JS实现仿新浪信息提示效果
https://www.onexin.net/the-user-experience-js-to-achieve-the-effect-of-imitation-sina-information-tips/

2、RedHat5上配置YUM方法以及YUM的使用方法
https://www.onexin.net/redhat5-methods-yum-and-yum-configured-to-use/

3、Discuz!Q Windows下提示 SSL 相关函数不可用如何解决?
https://www.onexin.net/discuzq-windows-ssl/

4、在PHP 5.3.x已棄用的功能
https://www.onexin.net/deprecated-features-in-php-5-3-x-2/

5、UCH会员动态Google Maps API幻灯切换效果
https://www.onexin.net/uch-member-dynamic-google-maps-api-slide-transition-effects/

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

Leave a Reply

Your email address will not be published. Required fields are marked *