Backgroud Changer

Posted: December 15, 2007 in JavaScript Stuffs

Heading Backgroud Changer

Description JavaScript “Backgroud Changes on click”

Preview N/A


<META NAME=”Generator” CONTENT=”Microsoft FrontPage 5.0″>
<LINK href=”general.css” rel=”stylesheet” type=”text/css”>
<!– Original:  Mark Whitnell ( –>
<!– Web Site: –>
<!– Begin
if (navigator.appName == “Microsoft Internet Explorer”) {
image_directory = “”;
clear = new Image();  clear.src = image_directory + “clear.jpg”;
pic1 = new Image();  pic1.src = image_directory + “chameleon.jpg”;
pic2 = new Image();  pic2.src = image_directory + “gecko.jpg”;
pic3 = new Image();  pic3.src = image_directory + “lizard.jpg”;
pic4 = new Image();  pic4.src = image_directory + “toad.jpg”;
function imagechange(imgName) {
if (navigator.appName == “Microsoft Internet Explorer”) {
document.body.background = eval(imgName + “.src”);
//  End –>


<BODY background=”clear.jpg” name=bg>
<a href=”#” onMouseOver=”imagechange(‘pic1’);” onMouseOut=”imagechange(‘clear’);”>
<img src=”chameleon.jpg” width=”320″ height=”193″></a>
<a href=”#” onMouseOver=”imagechange(‘pic2’);” onMouseOut=”imagechange(‘clear’);”>
<img src=”gecko.jpg” width=”335″ height=”193″></a>
<a href=”#” onMouseOver=”imagechange(‘pic3’);” onMouseOut=”imagechange(‘clear’);”>
<img src=”lizard.jpg” width=”334″ height=”191″></a>
<a href=”#” onMouseOver=”imagechange(‘pic4’);” onMouseOut=”imagechange(‘clear’);”>
<img src=”toad.jpg” width=”332″ height=”189″></a>


Leave a Reply

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

You are commenting using your 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