Как мне удалить, а затем добавить $ (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
});
Спасибо.