已创建 http://jsfiddle.net/jWwPV/某种下拉菜单。
<div class="dropdown_navigation_general" style="float:left;" >
<select name="general_select" id="general_select" onchange="window.document.location.href=this.options[this.selectedIndex].value;" value="general">
<option selected>General</option>
<option value="http://www.google.com">Add transaction partner</option>
</select>
</div>
.dropdown_navigation_general {
margin:auto;
width:70px;
overflow:hidden;
}
.dropdown_navigation_general select {
background: transparent;
width: 100px;
padding: 0px;
font-size: 14px;
border: 0px solid #fff;
height: 19px;
-webkit-appearance: none;
}
当我点击 Add transaction partner
时,我会在菜单顶部看到 Add transaction partner
而不是 General
.
是否有可能在单击菜单顶部的任何下拉菜单值后我总是看到General
(选定值)。
最佳答案
试试这个:
<select name="general_select" id="general_select"
onchange="window.document.location.href=this.options[this.selectedIndex].value;
this.value='general'">
关于使用下拉菜单的 HTML 导航。所选值必须始终出现在菜单顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19806476/