Log In · Register

 
backround change on click, whats the code???
lhuvhurts
post Aug 6 2004, 11:09 PM
Post #1


I C DEAD PEOPLE
*****

Group: Member
Posts: 728
Joined: Jul 2004
Member No: 36,002



whats the code for background change on click??
 
 
Start new topic
Replies
aznmech
post Aug 7 2004, 10:23 AM
Post #2


Senior Member
***

Group: Member
Posts: 63
Joined: Aug 2004
Member No: 36,605



ok try this code:

paste this code in html header, replace IMAGE URL with the url of the image rolleyes.gif

CODE
<!-- begin code provided by createblog.com -->
<script language="JavaScript">
<!--

var backImage = new Array();

backImage[0] = "IMAGE URL";
backImage[1] = "IMAGE URL";
backImage[2] = "IMAGE URL";
backImage[3] = "IMAGE URL";

// Do not edit below this line.
//-----------------------------

function changeBGImage(whichImage){
if (document.body){
document.body.background = backImage[whichImage];
}
}

//-->
</script>
<!-- end code provided by createblog.com -->


paste this code where you want the link change to be, replace (1) with the corresponding number in the [] in the script .. replace 'Change' with what you want the link to say

CODE
<!-- begin code provided by createblog.com -->
<a href="javascript:changeBGImage(1)">Change</a>
<!-- end code provided by createblog.com -->


to add more images, just copy the pattern
the code was on my friends website woo!

let me know how it goes
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: