📄 mfm1992
字号:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!-- Original: Tim Wallace
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
today=new Date();
jran=today.getTime();
var number = 7;
var random_number="";
var image="";
var text_color="";
ia=9301;
ic=49297;
im=233280;
jran = (jran*ia+ic) % im;
random_number = Math.ceil( (jran/(im*1.0)) *number);
// Loads the appropriate image and text color based on random number.
if (random_number==1) {
text_color="000000";
image="paper.gif";
}
if (random_number==2) {
text_color="000000";
image="wood.gif";
}
if (random_number==3) {
text_color="000000";
image="clouds.gif";
}
if (random_number==4) {
text_color="000000";
image="faces.gif";
}
if (random_number==5) {
text_color="000000";
image="marble.gif";
}
if (random_number==6) {
text_color="000000";
image="question.gif";
}
if (random_number==7) {
text_color="000000";
image="plain.gif";
}
// End -->
</script>
</head>
<body bgcolor="#FFFFFF">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.open();
document.write("<BODY BACKGROUND='"+image+"' TEXT='"+text_color+"'>");
document.write("<CENTER></CENTER>");
// End -->
</SCRIPT>
<div align="center">
<p><a href="../../../index.html">网猴</a>/源代码集锦/JavaScript源代码/<a href="index.htm">背景效果</a>/随机背景图像
</p>
<p> </p>
<FORM>
<INPUT TYPE="button" VALUE="Reload Page" onClick="window.location='r-images.html'">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("<CENTER>Background Image: <FONT SIZE=-1>("+image+")</FONT></CENTER>");
// End -->
</SCRIPT>
</div>
<p align="center">
<p align="center">
<p align="center">
<form>
<p align="center"> </p>
<p align="center">点击按钮,背景图形将不断变换。</p>
<p align="center">
<textarea name="textfield" cols="70" rows="20"><!-- FOUR STEPS TO INSTALL RANDOM IMAGES:
1. Paste the first code into the HEAD of your HTML document
2. Add the onLoad event handler to the BODY tag
3. Place the last script in the BODY of your HTML document
4. Save the 7 background images to your directory -->
<!-- STEP ONE: Paste this code into HEAD of your document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Tim Wallace
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
today=new Date();
jran=today.getTime();
var number = 7;
var random_number="";
var image="";
var text_color="";
ia=9301;
ic=49297;
im=233280;
jran = (jran*ia+ic) % im;
random_number = Math.ceil( (jran/(im*1.0)) *number);
// Loads the appropriate image and text color based on random number.
if (random_number==1) {
text_color="000000";
image="paper.gif";
}
if (random_number==2) {
text_color="000000";
image="wood.gif";
}
if (random_number==3) {
text_color="000000";
image="clouds.gif";
}
if (random_number==4) {
text_color="000000";
image="faces.gif";
}
if (random_number==5) {
text_color="000000";
image="marble.gif";
}
if (random_number==6) {
text_color="000000";
image="question.gif";
}
if (random_number==7) {
text_color="000000";
image="plain.gif";
}
// End -->
</SCRIPT>
</HEAD>
<!-- STEP TWO: Add this onLoad event handler to the BODY tag -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.open();
document.write("<BODY BACKGROUND='"+image+"' TEXT='"+text_color+"'>");
document.write("<CENTER></CENTER>");
// End -->
</SCRIPT>
<!-- STEP THREE: Place this script in the BODY of the HTML document -->
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Reload Page" onClick="window.location='r-images.html'">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("<CENTER>Background Image: <FONT SIZE=-1>("+image+")</FONT></CENTER>");
// End -->
</SCRIPT>
<!-- STEP FOUR: Save the 7 background images to your directory -->
<!-- Script Size: 2.38 KB -->
</textarea>
</p>
<p align="center"> </p>
</form>
<form name="">
<p align="center"> </p>
</form>
<p align="center"> </p>
<p align="center"> </p>
</body>
</html>