EventUtil.addHandler(window,‘scroll‘,function(){ var dafid = document.getElementById(‘dafid‘), eletop = dafid.getBoundingClientRect().top; if(eletop-549 <= 0){ dafid.className = ‘daf‘; }else{ dafid.className = ‘‘; } });
原文:http://www.cnblogs.com/xupeiyu/p/3850290.html