I am trying to unbind an element, an then bind it back after a page scroll animation completes:
$(".trigger").click(function(){
$(".class1 a, .class2 a").unbind();
$('html, body').stop().animate({scrollTop: $('#container').offset().top}, 1000);
$(".class1 a, .class2 a").bind();
});
.class1 a and .class2 a never get binded back, however?
If you want to bind back the event handler after the animation you’ll have to use a callback function. Also you have to pass a event type and callback to rebind the handler