jquery - disable click

后端 未结 7 1276
忘掉有多难
忘掉有多难 2020-12-04 15:27

I just want to disable the ability for a user to click on an element for some condition. Here is some of the code I am working with:

     $(\'#navigation a\         


        
7条回答
  •  半阙折子戏
    2020-12-04 16:00

    /** eworkyou **//

    $('#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"); // 
        }
        if (current >= 2){
        $("#navigation a:eq(1)").bind("click"); // 
        }
    

提交回复
热议问题