2013-05-31 67 views
2

我在jQuery UI Accordion中有一個表單。jQuery UI Accordion在關閉後不會重新打開

使用此代碼,訪問者必須驗證第一個面板,然後纔會打開下一個手風琴面板。但是,如果訪問者想回到第一個面板,它不會放過它。

$(document).ready(function() { 

    $("#accordion").accordion({ event: false }); 

    $('#openfirst').click(function() { 

     if (varification is okay then) { 

      $("#accordion").accordion({ active: 1 }); 

       // cancel submit 
       return false; 

      } else { 

       alert('Please acknowledge the following before proceeding.'); 

      } 

     }); 

     $('#opensecond').click(function() { 


      if (varification is okay then) { 

       $("#accordion").accordion({ active: 2 }); 

      } else { 

       alert('Please acknowledge the following before proceeding.'); 

      } 

     }); 

     $('#openthird').click(function() { 

      if (varification is okay then) { 

       $("#accordion").accordion({ active: 3 }); 

       // cancel submit 
       return false; 

      } else { 

       alert('Please acknowledge the following before proceeding.'); 

      } 

     }); 

    }); 
</script> 
+0

有人可以幫忙.. !!! ???? – JqueryGuy

回答

0

而不是使用使用

$(".selector").accordion("disable"); 

並且在用戶驗證

$("#accordion").accordion({ event: false }); 

嘗試的,使用

$(".selector").accordion("enable"); //for manual operation of tabs 

$(".selector").accordion({ active: # }); //for code generated operation of tabs 
相關問題