20131120

来源:互联网 发布:jquery循环json数组 编辑:程序博客网 时间:2024/06/06 02:20

文字闪烁:

<font id="blink" color="#fff">文字闪烁</font>  
<script>
setInterval(function(){blink.color=blink.color=='#fff'?'red':'#fff'},1000)
</script>

数字时钟:

<div id="clock"></div>

<script>

function changeClock(){
    var box = new Date();
    document.getElementById("clock").innerHTML = box.getFullYear() + "-" + (box.getMonth() + 1) + "-" + box.getDate() + " " + box.getHours() + ":" + box.getMinutes() + ":" + box.getSeconds();
}
window.setInterval(changeClock, 1000);
</script>

效果截图不太好截,就没截了。

原创粉丝点击