最佳答案
我是 jquery 和 bootstrap 的新手,所以请考虑我的错误。我已经创建了一个用于登录和注册的 bootstrap 模式。它包含两个名为 login 和 registrationI. 的导航选项卡,我有两个按钮,它们弹出相同的 Modal 窗口,但是在 Modal 窗口中显示不同的选项卡。每个选项卡中都有一个具有多个输入的窗体。我的问题是得到模态弹出与登录标签打开的模态时,我点击’登录’按钮和注册标签打开时,我点击’注册’按钮在我的网页上。
这是模式打开的两个链接:
<div class="header-login-li" style="background-color:gray;float:left;width:100px;height:60px;">
<a data-toggle="modal" href="#regestration" class="header-register-a" >
<big>
<font color="white" class="header-register-font"><center style="margin-top:20px;">Login <i class="icon-chevron-down" style="font-size:20px"></i></center></font>
</big></a></div>
<div class="header-register-li" style="background-color:green;float:right;margin-right:-15px;width:130px;height:60px;">
<a data-toggle="modal" href="#regestration" class="header-register-a" >
<big>
<font color="white" class="header-register-font"><center style="margin-top:20px;">Register</center></font>
</big></a>
下面是我的制表符代码和它们的内容(我在这里避免不必要的代码) :
<div class="tabbable" >
<ul class="nav nav-tabs" ><!--tabs-->
<li class="active" style="position:absolute;margin-left:0px;" id="logintab">
<a href="#pane_login" data-toggle="tab">Login</a></li>
<li style="margin-left:70px;" id="reg_tab" ><a href="#pane_reg" data-toggle="tab">Registration</a></li>
</ul>
<div class="tab-content"><!--login tab content-->
<div id="pane_login" class="tab-pane active">
<form id="login-form" target="login-signup-iframe" method="post" action="#" name="login-form">
</form>
</div><!--/pane_login-->
<div id="pane_reg" class="tab-pane"><!--registration tab content-->
<form id="regestration-form" target="login-signup-iframe" method="post" action="#" name="regestration-form">
</form>
</div>
</div><!-- /.tab-content -->
</div><!-- /.tabbable -->
我认为这可以通过 jquery 很容易地完成。但我不知道确切地如何做到这一点。 所以,谁能帮我解决我的问题。提前谢谢你?