ユーザーがある条件で要素をクリックし、後で別の条件で再バインドする機能を無効にしたいだけです。ここに私が取り組んでいるコードの一部があります:
$('#navigation a').bind('click',function(e){
var $this = $(this);
var prev = current;
current = $this.parent().index() + 1;
if (current == 1){
$("#navigation a:eq(1)").unbind("click"); // remove the click for element
}
if (current >= 2){
$("#navigation a:eq(1)").bind("click"); // this doesn't work, but i want re-bind the click here.
} }
これを機能させるにはどうすればよいですか?