I'm unbinding click from these clickable divs and then want to enable clicking again. What I have doesn't work. Any suggestions? Thanks.
$('#a, #b, #c').on('click', function(e){
$('#a, #b, #c').unbind('click');
// some stuff
// bind again:
// this doesn't work: $('#a, #b, #c').bind('click');
}
You are missing the handler function // this doesn't work: $('#a, #b, #c').bind('click');
when you try to rebind.. what you need is something like below,
$('#a, #b, #c').bind('click', clickHandlerA);
function clickHandlerA() {
$('#a, #b, #c').unbind('click');
// some stuff
// bind again:
// this should work:
$('#a, #b, #c').bind('click', clickHandlerA);
}