[网页高手]
Homepage
[网络编程]
Programe
[图形图像]
Picture
[冲浪宝典]
Insernet
[操作系统]
System
[软件教学]
Software
[数码时代]
Didgtale
[安全防御]
Didgtale
[IT学院]
Education
    
 
Google Web tongyi.net
 
    你的位置:首页 > 网页高手 > HTML > 网页常用特效整理:中级篇
网页高手
  Dreamweaver

FrontPage

Javascript

HTML

CSS

XML

心得技巧

DHTML

 
网页常用特效整理:中级篇

中级篇

  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>

 

     打印本文 | 推荐朋友 | 收藏文章 | 关闭窗口
 
 

    相关文章
 网页常用特效整理:初级篇    (2005年7月9日)

 在浏览器地址栏前添加自定义的小图标    (2005年5月27日)

 HTML Converter 转换代码小工具    (2004年12月7日)

 浅谈无刷新取得远程数据技术    (2004年9月25日)

 shtml网页SSI使用详解    (2004年6月22日)

 HTML中小meta的大作用    (2004年2月10日)

 HTML-加速、再加速(下)    (2003年11月10日)

 HTML-加速、再加速(上)    (2003年11月10日)

 
 

 

关于统一 | 联系合作 | 统一作品 | 版权申明 | 建站服务 | 更多说明
Copyright 2000-2003 Tongyi All rights reserved. 京ICP备05005608号