时间: 2021-07-31 作者:daque
笔者积少成多了很多精粹、适用的web殊效的创造,那些殊效简直都是比拟常用的网页殊效。此刻我就把那些过程整治和窜改过的殊效分三个级别辨别引见给大师。 中级篇 1.节日倒计时 <script language="javascript"> var timedate= new date("october 1,2002"); var times="国庆节"; var now = new date(); var date = timedate.gettime() - now.gettime(); var time = math.floor(date / (1000 * 60 * 60 * 24)); if (time >= 0) document.write("此刻离"+times+"再有: "+time +"天")</script> 2.单击按钮打字与印刷出暂时页 <script language="javascript"> <!-- begin if (window.print) { document.write('<form>' + '<input type=button name=print value="打套印本页" ' + 'onclick="javascript:window.print()"></form>'); } // end --> </script> 3.单击按钮‘另存为’暂时页 <input type="button" name="button" value="生存本页" onclick="document.all.button.execwb(4,1)"> <object id="button" width=0 height=0 classid="clsid:8856f961-340a-11d0-a96b-00c04fd705a2"> <embed width="0" height="0"></embed> </object> 4.表露体例暂时日子 <script language=javascript> today=new date(); function date(){ this.length=date.arguments.length for(var i=0;i<this.length;i++) this[i+1]=date.arguments[i] } var d=new date("礼拜日","礼拜一","礼拜二","礼拜三","礼拜四","礼拜五","礼拜六"); document.write( "<font color=##000000 style='font-size:9pt;font-family: 宋体'> ", today.getyear(),"年",today.getmonth()+1,"月",today.getdate(),"日", d[today.getday()+1],"</font>" ); </script>