我的導航欄有下拉「字段集」的登錄和搜索這樣的:保持下拉可見的,而輸入框都集中
<div class="nav-button" id="nav-box">
<a class="inside-link">
<span id="inside-text">Sign in</span>
</a>
<fieldset id="menu-box" class="menu-box">
<form method="post" id="forms" class="forms" action="checklogin.php">
<label for="username">Username or email</label>
<input type="text" id="username" name="username" value="" title="username" tabindex="4">
<label for="password">Password</label>
<input type="password" id="password" name="password" value="" title="password" tabindex="5">
<input type="submit" id="small-btn" value="Sign in" tabindex="6">
<input type="checkbox" id="remember" name="remember_me" value="1" tabindex="7">
<label for="remember">Remember me</label>
<br />
<a href="#"id="resend_password_link">Forgot your password?</a>
<a id='forgot_username_link' title="If you remember your password, try logging in with your email" href="#">Forgot your username?</a>
</form>
</fieldset>
</div>
我這裏有一個小提琴:http://jsfiddle.net/WBrns/5/
雖然輸入框,如「搜索」關注「用戶名」和「密碼」,我希望關聯的下拉列表不會消失,因此用戶在鍵入時不必將鼠標放在下拉列表中。
在CSS 288線是我們第一次這顯然是行不通的嘗試。我的網站已經包括jQuery的,所以任何的js/jQuery的解決方案是可以接受的(因爲我認爲這是不可能的,純CSS)
謝謝!
你可以在'focusin'添加監聽器和'focusout'的輸入,以去除(的focusIn)或再追加(事件的內容)的CSS允許您隱藏菜單的類。 – MatRt 2013-03-19 23:19:29