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