1.定时器的基本使用
开启:timer = setInterval(函数,时间) //无限次数的执行
setTimeout(函数,时间) //只执行一次
关闭:clearInterval(timer);//关闭相应的计时器
clearTimeout();
2.数码时钟
获取系统时间:Date对象
var oDate = new Date();
oDate.getHours() ;时
oDate.getMinutes();分
oDate.getSeconds();秒
charAt(字符串); 取字符串的某一位,解决兼容性
oDate.getFullYear(); 年
oDate.getMonth()+1; 月
oDate.getDate(); 日
oDate.getDay(); 星期几
3.延时提示框(延时提示框代码)
使用setTimeout
4.无缝滚动(无缝滚动代码)
offsetWidth
offsetLeft