[英]Bootstrap: login form in dropdown navbar menu
我在下拉導航欄項中創建了登錄表單。 即使使用響應式ui,它的工作也很酷,但是存在一個問題。 當我將桌面瀏覽器調整為手機大小時,我仍然可以打開菜單,關注用戶名,密碼輸入,然后按提交。 但是在電話上,我可以擴大登錄位置,但是當我觸摸輸入或按鈕時,子菜單會隱藏。 您有什么想法我該如何解決?
工作代碼: http : //jsfiddle.net/D2RLR/4324/
<li class="dropdown">
<a class="dropdown-toggle" href="#" data-toggle="dropdown">Loguj<strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
<form action="http://localhost/fabrykagier/auth/login" method="post" accept-charset="UTF-8">
<input id="user_username" style="margin-bottom: 15px;" type="text" name="identity" size="30" placeholder="e-mail">
<input id="user_password" style="margin-bottom: 15px;" type="password" name="password" placeholder="hasło" size="30">
<input id="user_remember_me" style="float: left; margin-right: 10px;" type="checkbox" name="remember" value="1">
<label class="string optional" for="user_remember_me"> Pamiętaj mnie</label>
<input class="btn btn-primary" style="clear: left; width: 100%; height: 32px; font-size: 13px;" type="submit" name="commit" value="Zaloguj">
</form>
</div>
</li>
這可能是您需要的:
$(function(){
// Fix input element click problem
$('.dropdown input, .dropdown label').click(function(e) {
e.stopPropagation();
});
});
來源: http : //mifsud.me/adding-dropdown-login-form-bootstraps-navbar/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.