【问题标题】:Not able to Select in Select Box over Menu无法在菜单上的选择框中选择
【发布时间】:2013-07-30 16:25:33
【问题描述】:

只有在我的菜单上选择选项时,我才在选择框上选择选项时遇到问题。我使用的菜单是一个插件 Jquery。

When the select box is over the menu the options is going back.我尝试将 z-index 赋予我的 div,但它没有帮助我。有人可以帮我解决这个问题吗.. 这对我来说是一个新问题...

我的 HTML:

<div id="top-search">
        <form nmae='name123' action="queryexecute.php" method="POST">
        <table border="0" cellpadding="0" cellspacing="0">
        <tr>
        <select class="styledselect" name="field_2" style="width:100px;" autocomplete="on" placeholder="Show" required="">
            <option value="">Select</option>
            <option value="=">Equal</option>
            <option value="!=">Not equal</option> 
            <option value="LIKE">Like</option> 
            <option value="&gt;">Greater</option> 
            <option value="&lt;">Lesser</option>
            <option value="&gt;=">Greater than or equal to</option> 
            <option value="&lt;=">Lesser than or equal to</option>
            <option value="!==">Not identical</option></select>
        </select>
        </td>
        <td>
        <select class="styledselect" name="field_1" id="field_1" style="width:100px;" autocomplete="on" placeholder="Show" required="">
          <option value="">Select</option>
           <option value="`ShibAzmnNo`">no</option>
        </select>
        </td>
        <td>
        <input name='' type="submit" src="images/shared/top_search_btn.gif"  />
        </td>
        </tr>
        </table>
    </form>
    </div>

我的 CSS:

#top-search {
    display: inline;
    float: right;
    position: relative;
    margin: 46px -150px 0 0;
    z-index: 1;
    }

【问题讨论】:

标签: jquery html css forms drop-down-menu


【解决方案1】:

它的z-index 问题你应该将select 的父元素的z-index 增加到menu 的父元素

喜欢

<div style="position:relative;z-index:9999">select item</div> 

<nav style="position:relative;z-index:99">menu items</nav> 

#top-search{z-index:9999;}

【讨论】:

  • evn​​ 当我将 z-index 设置为 20 时,问题仍然没有得到解决.. 有什么想法吗?
  • 请同时将 z-index 指定给 nav,它应该小于 #top-search 并添加相对于菜单容器的位置
  • 我没有这样做,如果我投了反对票,为什么我会回答它
  • 我认为人们也想要一个小提琴链接,他们不赞成你投票
  • 不客气,因为我有这么多的经验,我可以一眼就告诉你这是一个 z-index 问题,但你应该提供一个可靠的链接来测试你的代码,这是这里的规则
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-28
  • 1970-01-01
  • 2014-01-06
  • 2016-01-28
  • 1970-01-01
相关资源
最近更新 更多