0

我的页面中有两个折叠。我在 collapsOne 中有 Btn_First。当页面加载时,我想 collapsOne 会出现并且 collapsTwo 没有。当 Btn_First clicked 时,会出现 collapsTwo。我确实喜欢下面。一切都正确,我在 MyFunc 中收到警报。但 collapsTwo 不会出现。

<div class="accordion-group">
    <div class="accordion-heading">
       <a class="accordion-toggle" data-toggle="collapse" data- parent="#checkout" href="#collapseOne"> First Step</a>
    </div>
    <div id="collapseOne" class="accordion-body collapse">
       <div class="accordion-inner">
          <form class="register-form">
             <input class="input-block-level" type="text" placeholder=" Name  " id="inputname">
             <input class="input-block-level" type="text" placeholder="Lname  " id="inputlname">
             <button class="btn btn- medium btn-general input-block-level" data-toggle="collapse" href="#collapseOne" type="submit"  id="Btn_First" ">Run </button>
          </form>
       </div>
    </div>
 </div>
 /////////////////

 <div class="accordion-group">
    <div class="accordion-heading">
       <a class="accordion-toggle" data-toggle="collapse" data-parent="#checkout" href="#collapseTwo"> First Step</a>
    </div>
    <div id="collapseOne" class="accordion-body collapse">
       <div class="accordion-inner">
          <form class="register-form">
              <input class="input-block-level" type="text" placeholder=" Email  " id="inputEmai;">
              <input class="input-block-level" type="text" placeholder="Phone  "  id="inputPhone">
              <button class="btn btn- medium btn-general input-block-level" data-toggle="collapse" href="#collapseTwo" type="submit"  id="Btn_Second" ">Run </button>
         </form>
       </div>
     </div>
  </div>

  ///////////////////

  <script type="text/javascript">
     $( document ).ready( function () {
        $("#collapseTwo").remove();
        $('#Btn_First).click(function () {
            if ( Mytemp == mytemp){ myfunc( 2 );}
        });
     )};
     function myfunc( flag ) {
        alert('hi');
     if ( flag == 2 ) {
        document.getElementById('collapseTwo').style.display = "visible";
        }
    }
</script>
4

1 回答 1

0
       <script type="text/javascript">
                    $(document).ready(function()
                   {
             $("#collapseTwo").hide();
                 $("#Btn_First").click(function()
          {
             GoFunc(2); 

               });

                    });

                      function Gofunc(2)
    {
     document.getElementById('collapseTwo').style.display = "block";  

    }

</script>
于 2013-09-19T06:19:19.973 回答