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ڞ-7/+x%@ K e ࣝ#'v!ܝX3@a:@#<,KJ Vy'KMC29 )x=0dSDiboQ\R 1h7_"EnEvPiፒT"?KCq\4r̵ʁ҈o9Ifb (DɉT46XbP~)/璕,Һrki_ O$99Ɔ7̓sJa`Gd7aJ-gp[v)㵨*˕ݽxٷ4+V& @(ԍ<}Q36p\έ\s_v uLj$^p z樛+\iLu9RThA.ȩc3{[JavHAD.AHSQ[){LV @\T;'DYH"CgGc<`eDh(sx'K1y+uleBaW_*F3ED[)Q)^hHvX 6`z@@lȟ4n :DPW2SsbU`(P߈c35Mө?zz0r 6 2mRȋvA#cQi%OGz(%I~@=L]BPU.ڞ6ĒhnX59!, UPd9. xaL~b֑ c9"43D(Fh(!suC GMۭ4ΘqȷW5nLF\-0X99|T8pN>r@FJ?dlӷ}k5j挄Ռt9 xPM[b*֛gz ZDZ&ߊGsK{_Xq.b@]o@QFѽMG ?AYLxtcfхz&FБd=H,8o͆n˜G CL^Gi"UYXF?LWNY9HҝkeDMם0~iEG1Ur QZ2oVr}N1di^'ccF X)SKşa\_uݠ\ٽLM.Ge<+'nPS;Anwm@MAUNA'y,_ޖ,fll?!#${6GWStb}ꄚږ1Ohmd䗆(fJ^٢~nwޝZA6UoUA7#5\Ez+Bd@`(SM]ri5VkO

用JAVASCRIPT实现一些随机事件

类别: JavaScript教程  评论数:0 总得分:0
1、随机广告

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="The World"s Largest Online Bookstore, Amazon.com";
url="http://www.amazon.com";
alt="amazon.com";
banner="http://imageserv.imgis.com/images/Ad12669St1Sz1Sq1_Ban1.gif";
width="468";
height="60";
}
if (ad==2) {
txt="Palm III by 3Com, in stock!";
url="http://cybershop.com/";
alt="cybershop.com";
banner="http://imageserv.imgis.com/images/Ad13189St1Sz1Sq5_Ban10.gif";
width="468";
height="60";
}
if (ad==3) {
txt="Find it at GoTo.com";
url="http://www.goto.com";
alt="goto.com";
banner="http://imageserv.imgis.com/images/Ad13700St1Sz1Sq1_Ban1.gif";
width="468";
height="60";
}
document.write("<center>");
document.write("<a href="" + url + "" target="_top">");
document.write("<img src="" + banner + "" width=")
document.write(width + " height=" + height + " ");
document.write("alt="" + alt + "" border=0>
");
document.write("<small>" + txt + "</small></a>");
document.write("</center>");
// End -->
</SCRIPT>
2、随机背景颜色

<HTML>
<HEAD>
<TITLE>Random Background</TITLE>

<SCRIPT LANGUAGE="JavaScript">
<!--
function backcolor(form) {
temp = ""
for (var i = 0; i < 16; 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 > 44)
backgroundcolor = backgroundcolor - 45
else if (backgroundcolor > 29)
backgroundcolor = backgroundcolor - 30
else if (backgroundcolor > 15)
backgroundcolor = backgroundcolor - 16
if (backgroundcolor == 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 )
return "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 == 10 )
return "gray";
else if (backgroundcolor == 11 )
return "yellow";
else if (backgroundcolor == 12 )
return "aqua";
else if (backgroundcolor == 13 )
return "black";
else if (backgroundcolor == 14 )
return "white";
else if (backgroundcolor == 15 )
return "silver";
}
// End -->
</SCRIPT>
</HEAD>

<BODY BGCOLOR=#ffffff vlink=#0000ff>

<CENTER>
<FORM>
<input type="button" value="随机背景颜色" onClick="randombackground()">
</FORM>
</CENTER>

</body></html>

3、随机背景图案

<HTML>
<HEAD>
<TITLE>Random Images</TITLE>

<SCRIPT LANGUAGE="JavaScript">

today=new Date();
jran=today.getTime();
var number = 3;
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);

if (random_number==1) {
text_color="000000";
image="bg1.gif";
}
if (random_number==2) {
text_color="000000";
image="bg2.jpg";
}
if (random_number==3) {
text_color="000000";
image="bg3.gif";
}
// End -->
</SCRIPT>
</HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.open();
document.write("<BODY BACKGROUND=""+image+"" TEXT=""+text_color+"" vlink=#0000ff>");
document.write("<CENTER></CENTER>");
// End -->
</SCRIPT>

<FORM>
<INPUT TYPE="button" VALUE="Reload Page" onClick="window.location="RandomBgImages.htm"">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("<CENTER><FONT SIZE=-1 color=red>Background Image: ("+image+")</FONT></CENTER>");
// End -->
</SCRIPT>

</body></html>
4、随机图案

把以下代码放在<head></head>之间:
<script language="JavaScript">
a = 4
var slump = Math.random();
var talet = Math.round(slump * (a-1))+1;
function create() {
    this.src = "
    this.border = "
this.alt = "
}

b = new Array()
for(var i=1; i<=a; i++) { b[i] = new create() }

b[1].src  = "reset.gif"
b[1].border = "0"
b[1].alt  = "111"

b[2].src  = "back.gif"
b[2].border = "0"
b[2].alt  = "222"

b[3].src  = "ie.gif"
b[3].border = "0"
b[3].alt  = "333"

b[4].src  = "netscape.gif"
b[4].border = "0"
b[4].alt  = "444"

var visa = "";
visa += "<img src="+b[talet].src+" border="0""+" alt="+b[talet].alt+">";
</SCRIPT>

把以下代码放在HTML文件任意地方:
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write(visa)
// -->
</script>
5、随机播放MIDI音乐

把以下代码放在<head></head>之间:
<script language="JavaScript">
<!--Hide from non JavaScript browsers
am = 5
var ran = Math.random();
var talet = Math.round(ran * (am-1))+1;
function create() {
    this.src = "
}

c = new Array()
for(var i=1; i<=am; i++) { c[i] = new create() }

c[1].src  = "hh1.mid"
c[2].src  = "hh2.mid"
c[3].src  = "hh3.mid"
c[4].src  = "hh4.mid"
c[5].src  = "hh5.mid"
var vismid = "";

vismid += "<embed src="+c[talet].src+" width=0 height=0"+" autostart=true"+" loop=2"+">";
//-->
</SCRIPT>
把以下代码放在<body></body>之间:
<script language="JavaScript">
<!--Hide from non JavaScript browsers
document.write(vismid);
//-->
</script>
6、随机文本

把以下代码放在<head></head>之间:
<script language="JavaScript">
<!-- Hide
var a = Math.random() + ""
var rand1 = a.charAt(5)
quotes = new Array
quotes[1] = "MESSAGE #1"
quotes[2] = "MESSAGE #2"
quotes[3] = "MESSAGE #3"
quotes[4] = "MESSAGE #4"
quotes[5] = "MESSAGE #5"
quotes[6] = "MESSAGE #6"
quotes[7] = "MESSAGE #7"
quotes[8] = "MESSAGE #8"
quotes[9] = "MESSAGE #9"
quotes[0] = "MESSAGE #10"
var quote = quotes[rand1]
// -->
</script>
把以下代码放在HTML文件任意地方:
<script language="JavaScript">
<!-- Hide
document.write("<i>" + quote + "</i>")
// -->
</script>
7、随机连接

把以下代码放在<head></head>之间:
<script language="JavaScript">
<!--Hide from non JavaScript browsers
an = 5
var ran = Math.random();
var talet = Math.round(ran * (an-1))+1;
function create() {
    this.src = "

}

b = new Array()
for(var i=1; i<=an; i++) { b[i] = new create() }

b[1].src  = "<a href="http://www.4ico.com">"
b[2].src  = "<a href="http://www.disney.com">"
b[3].src  = "<a href="http://www.peoplelink.com/">"
b[4].src  = "<a href="http://www.etoow.com">"
b[5].src  = "<a href="HTTP://www.fcxx.net">"
var vis = "";
vis += b[talet].src;
//-->
</SCRIPT>
把以下代码放在<body></body>之间:
<script language="JavaScript">
<!--Hide from non JavaScript browsers
document.write(vis+"random link"+"</a>");
//-->
</SCRIPT>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:

纯粹空间 softpure.com
Copyright © 2006-2012 暖阳制作 版权所有
承接程序设计 网页设计
QQ: 15242663 (隐身在线 拒绝闲聊)  Email: faisun@sina.com

 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛  

百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备06033747号