2014-02-10 30 views
0

我在函數中jquery.steps.js庫來到step 1,但留在step 3jQuery的步驟庫和GoToStep功能

貝婁是我的腳本:

  $("#wizard-2").steps({ 
       headerTag: "h3", 
       bodyTag: "section", 
       transitionEffect: "slideLeft", 
       onStepChanging: function (event, currentIndex, newIndex) 
       { 
        $("#form-2").validate().settings.ignore = ":disabled,:hidden"; 
        return $("#form-2").valid(); 
       }, 
       onFinishing: function (event, currentIndex) 
       { 
        $("#form-2").validate().settings.ignore = ":disabled"; 
        return $("#form-2").valid(); 
       }, 
       onFinished: function (event, currentIndex) 
       { 
        $('<input />').attr('type', 'hidden') 
        .attr('name','ssl') 
        .attr('value', 'true') 
        .appendTo('#form-2'); 
        document.getElementById("form-2").submit(); 
       } 
      }); 
      <? if ($_POST['submit']) 
        echo "$(\"wizard-2\").goToStep(this, ,3,0);"?> 

但我相信我的這個函數的執行是非常糟糕的原因是不行的。任何人都可以幫我解決這個腳本?

回答

1

我自己想通了。問題很簡單,它是關於正確設置屬性startIndex像:

<? 
if (Env::value('generate')) 
    echo "startIndex: \"2\","; 
?>