This seems to be a very popular question though i didn't seem to find any pertinat answers.
I attach an event listen like :
window.addEventListener('scroll', fnName, false);
The problem is that fnName expect several parameters, so i then triedl
window.addEventListener('scroll', (function( e ){
return fnName(e, some, param )
}()), false)
but then window.removeEventListener
do not work anymore so i tried:
window.removeEventListener('scroll', (function( e ){
return fnName(e, some, param )
}()), false)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…