2-way background images slides

Posted: December 16, 2007 in JavaScript Stuffs

Heading 2-way background images slides

Description JavaScript “Background images slides”

Preview N/A

Code

 <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 3.2 Final//EN”>
<HTML>
<HEAD>
<META NAME=”Generator” CONTENT=”Microsoft FrontPage 5.0″>
<LINK href=”general.css” rel=”stylesheet” type=”text/css”>
<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
// (C) 2001 http://www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

// =======================================
// set the following variables
// =======================================

// Set speed (milliseconds)
var speed = 1000

// Specify the image files
var Pic = new Array() // don’t touch this
// to add more images, just continue
// the pattern, adding to the array below

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 Background=../graphics/grayback.jpg onload=”runBGSlideShow()”>
<center><BR><BR><BR>

</center>
</BODY>
</HTML>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s