How can I remove and then add the $(window).scroll
? I need to store a variable and reuse it after some event.
// 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
});
Thank you.