码迷,mamicode.com
首页 > Web开发 > 详细

js语言精粹P38

时间:2014-09-29 10:54:17      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:style   color   io   os   ar   sp   on   c   cti   

<script>
var fade=function(node){
    var level=1;
    var step=function(){
        var hex=level.toString(16);
        node.style.backgroundColor=‘#‘+hex+hex+hex+hex+hex+hex;
        if(level<15){
            level+=1;
            setTimeout(step,100);
        }
    };
    step();//setTimeout(step,100);
};
fade(document.body);

</script>

js语言精粹P38

标签:style   color   io   os   ar   sp   on   c   cti   

原文地址:http://www.cnblogs.com/dingyuanxin/p/3999510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!