笔者日积月累了许多精彩、实用的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>
以上就是网页常用特效整理:中级篇的内容,更多相关内容请关注PHP中文网(www.php.cn)!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号