原生计算浏览器高度

1
2
3
4
5
6
7
8
9
10
11
EventUtil.addHandler(window,'scroll',function(){
 
    var dafid = document.getElementById('dafid'),
        eletop = dafid.getBoundingClientRect().top;
        if(eletop-549 <= 0){
            dafid.className = 'daf';
        }else{
            dafid.className = '';
        }
 
});

posted on 2014-11-03 10:40  鬼鬼丫404  阅读(90)  评论(0编辑  收藏  举报

导航