原生计算浏览器高度

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 @ 2014-07-17 10:02  唸随爱  阅读(166)  评论(0编辑  收藏  举报