// --End Hiding Here --> </script>
</head> <body bgcolor="ffffff"> <center> <br><br><br> <hr width=100%> <SCRIPT LANGUAGE="javascript"> <!-- {rainbow("-->用javascrip创建的彩虹字<!__");} //--> </SCRIPT> <hr width=100%> </center> </body> </HTML>
11 声音播放控制
用javascript进行声音播放控制 <html> <head> <title>用javascript进行声音播放控制</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <script language="javascript"> <!-- //定义一个声音播放控制的function, 需注意Netscape和IE对script的解释各不相同 function MM_controlSound(sndAction,sndObj) { if (eval(sndObj) != null) { if (navigator.appName==Netscape) eval(sndObj+((sndAction==stop)?.stop():.play(false))); else if (eval(sndObj+".FileName")) eval(sndObj+((sndAction==stop)?.stop():.run())); } } //--> </script> </head>
<body> <!-- 开始控制声音播放 --> <embed name=MM_controlSound1 src=sound.wav loop=false autostart=false mastersound hidden=true width=0 height=0></embed> <!-- 用onMouseOver控制声音播放 --> <a href="#" onMouseOver="MM_controlSound(play,document.MM_controlSound1)"> 当鼠标移到这儿时会播放声音</a> </body> </html>
12 按时问好 function SayHello(){ var today = new Date(); var hours = today.getHours(); var minutes = today.getMinutes(); var string = "嗨!您好,现在是: "; string =string+hours+" 点 "+minutes+" 分;"; if(hours==0) alert(string + "已经是午夜零点多了, 哇你的精神好好嗳! .^."); if(hours==1) alert(string + "己经是午夜壹点 多啦!还在游荡哪?再不睡,明儿个要钓鱼喽!"); if(hours==2) alert(string + "己经是午夜贰点 多了,在找什么东东吗?要不要帮忙?"); if(hours==3) alert(string + "己经是午夜叁点 多了喔!还没睡?真是现代网络夜猫子!^_^"); if(hours==4) alert(string + "己经是午夜肆点 多了,真不困哪?佩服!佩服!"); if(hours==5) alert(string + "这么早起床? 还是彻夜未眠呀?"); if(hours==6) alert(string + "早晨好! 新的一天又开始啦!"); if(hours==7) alert(string + "早安! 早饭可很重要哦,吃饱没有?"); if(hours>7 && hours<11) alert(string + "早!又是忙碌的一天,祝行事顺利!"); if(hours==11) alert(string + "快中午啦, 饿不饿?可别胡弄自己呀!"); if(hours==12) alert(string + "中午喽!吃饱没有? 是准备猫一小觉,还是出去晒晒太阳?"); if(hours>12 && hours<15) alert(string + "下午是 最容易犯困的时候,可要提起精神哦。"); if(hours==15) alert(string + "来杯下午茶吧! 休息是为了走更远的路嘛!"); if(hours>15 && hours<18) alert(string + "又开始 期待下课/班了吧?不过一定要今日事,今日毕呦!"); if(hours==18) alert(string + "在加班还是休息, 身体可是第一位的啊。"); if(hours==19) alert(string + "吃了吗?别忘了 抽点时间跟爱人聊聊天!"); if(hours==20) alert(string + "不爱看电视吧? 太闷?来我这里就对啦!"); if(hours>20 && hours<23) alert(string + "晚上好! 是不是开始泡网啦?我这儿是最佳选择!"); if(hours==23) alert(string + "快午夜了, 要不要来块点心;注意身体别太辛苦了?"); } SayHello();
上一篇:字体网站篇
下一篇:判断Cookies是否处于开启状态
|