Tuesday, March 2, 2010

Changing Background 4 your site

What this script will do is change your background image after a fixed time period. U can add as many images as U want. I have not seen anything like that on any site yet. But who knows.
So I have this script take it or leave it your choice.
<html>
<head>
<script language="JavaScript">
<!-- This is not my script nor do I claim any rights on it. If U want U can give me D credits 4 bringing it 2 U
// Set speed (milliseconds)
var speed = 1000

// Specify the image files
var Pic = new Array() // don't touch this

Pic[0] = '1.gif'
Pic[1] = '2.gif'
Pic[2] = '3.gif'
Pic[3] = '4.gif'

// do not edit anything below this line

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){ preLoad[i] = new Image() preLoad[i].src = Pic[i] } function runBGSlideShow(){ if (document.body){ document.body.background = Pic[j]; j = j + 1 if (j > (p-1)) j=0
t = setTimeout('runBGSlideShow()', speed)
}}
// End -->
</script>
</head>
<body onload="runBGSlideShow()">

</body>
<html>

Just ad more bg pics after Pic[3] = '4.gif' and U R done.

No comments:

Post a Comment