1, Button style
Copy Code code as follows:
<script>
org_color=document.bgcolor.substring (1.10)
</script>
<form>
<input type= "button" value= "Light yellow Background" onclick= "document.bgcolor= ' #feffc6 '" >
<input type= "button" value= "Light blue Background" onclick= "document.bgcolor= ' #c6fffe '" >
<input type= "button" value= "Pink Background" onclick= "document.bgcolor= ' #ffc9c6 '" >
<input type= "button" value= "Green Background" onclick= "document.bgcolor= ' #508b7d '" >
<input type= "button" value= "sky-blue background" onclick= "document.bgcolor= ' #7BC7FF '" >
<input type= "button" value= "Rice white background onclick=" document.bgcolor= ' #f0f0f0 ' ">
</form>
2, drop down style
Copy Code code as follows:
<selectonchange= "Document.bgcolor=this.options[this.selectedindex].value" >
<option value= "#C0C0C0" > Grey
<option value= "Black" > Dark color
<option value= "d2c6ff" > Light violet Blue
<option value= "Feefc7" > Sun yellow
<option value= "ffd2c6" > Reddish orange
<option value= "C7fed8" > Apple green
<option value= "80ff80" > Grassland green
<option value= "#C1BC59" > Olive
<option value= "#7BC7FF" > Sky blue
<option value= "#AEDFD3" > Blue-Green
<option value= "#508B7D" > Dark green
<option value= "#F0F0F0" > M white
</select>
3, Touch style
Copy Code code as follows:
<scriptlanguage= "Javascript" >
<!--
function BackColor (form) {
temp = ""
for (var i = 0; i < i++) {
temp = Form.color[i].value
if (form.color[i].checked) {document.bgcolor = temp}
}
}
function Randombackground () {
Document.bgcolor = GetColor ()
}
Function GetColor () {
currentdate = new Date ()
BackgroundColor = Currentdate.getseconds ()
if ( BackgroundColor >)
BackgroundColor = backgroundcolor-45
Else if (BackgroundColor >)
Backgroundco Lor = backgroundcolor-30
Else if (BackgroundColor >)
backgroundcolor = backgroundcolor-16
if (backgr Oundcolor = = 0)
return "Olive";
else if (backgroundcolor = = 1)
return "teal";
else if (backgroundcolor = = 2)
return "Red";
else if (backgroundcolor = 3)
return "Blue";
else if (backgroundcolor = 4)
RET Urn "Maroon";
Else if (backgroundcolor = 5)
Return "Navy";
Else if (backgroundcolor = = 6)
return "lime";
Else if (BackgroundColor = 7)
return "Fuschia";
Else if (backgroundcolor = 8)
return "green";
else if (backgroundcolor = = 9)
return "purple";
Else if (backgroundcolor = =)
return "Gray";
else if (backgroundcolor = =)
Return yellOw ";
Else if (backgroundcolor = =)
return "Aqua";
Else if (backgroundcolor =)
return "BLACK";
Else if (backgroundcolor = =)
return "white";
else if (backgroundcolor = =)
return "silver";
}
//;
</script>
<body onload= "document.bgcolor= ' lime '; returntrue;"
<a href= "javascript:void (0);" Onmouseover= "Randombackground ()" ><fontsize= "5" face= "Song body" > Touch Me change background color </font></a>
Click to change background picture:
Copy Code code as follows:
<div style= "float:right;margin-right:20px;" >
<ahref= "javascript:void (0);" ><imgclass= "Button1" onclick= "javascript:document.body.style.background= ' url (images/bg/1.jpg) '" ></a >
<ahref= "javascript:void (0);" ><imgclass= "Button2" onclick= "javascript:document.body.style.background= ' url (images/bg/2.jpg) '" ></a >
<ahref= "javascript:void (0);" ><imgclass= "Button3" onclick= "javascript:document.body.style.background= ' url (images/bg/3.jpg) '" ></a >
<ahref= "javascript:void (0);" ><imgclass= "Button4" onclick= "javascript:document.body.style.background= ' url (images/bg/4.jpg) '" ></a >
<ahref= "javascript:void (0);" ><imgclass= "Button5" onclick= "javascript:document.body.style.background= ' url (images/bg/5.jpg) '" ></a >
<ahref= "javascript:void (0);" ><imgclass= "Button6" onclick= "javascript:document.body.style.background= ' url (images/bg/6.jpg) '" ></a >
</div>
IE6 solutions are not available:
Copy Code code as follows: