如何删除然后添加$(window).scroll
?我需要存储一个变量并在某些事件后重用它。
// here i store my var
$(window).scroll(function(){
myScroll = $(window).scrollTop()
});
$("#itemUnbind").click(function(){
// here i need to remove the listener
});
$("#itemBind").click(function(){
// here i need to add listener again
});
谢谢你。