javascript事件绑定,取消,addEventListener,removeEventListener,attachEvent,detachEvent
javascript事件绑定,取消,addEventListener,removeEventListener,attachEvent,detachEvent
function removeScroll() { //alert(1); if (document.removeEventListener) { window.removeEventListener('scroll', fixedFun, false); } else { window.detachEvent('onscroll', fixedFun); } } document.addEventListener ? window.addEventListener('scroll', fixedFun, false) : window.attachEvent('onscroll', fixedFun); document.addEventListener ? document.body.addEventListener('click', removeScroll, false) : document.body.attachEvent('onclick', removeScroll);