Firefox下拉菜单点击

时间:2015-06-17 09:54:21

标签: html firefox select drop-down-menu

我的网站上有一个语言下拉菜单,它可以在Google Chrome,Safari和Internet Explorer中正常使用,但它在Firefox中出现了问题。

这是代码:

<a href="">
    <select id="languageSelector" style="background-color: transparent" onchange="location = this.options[this.selectedIndex].value;">
        <option value=".">ESPAÑOL</option>
        <option value="./en/index.html">ENGLISH</option>
        <option value="./de/index.html">DEUTSCH</option>
        <option value="./fr/index.html">FRANÇAIS</option>
        <option value="./nl/index.html">NEDERLANDS</option>
    </select>
</a>

它也有罕见的行为。如果我使用键盘移动选择并按Enter键,它可以工作,但是用鼠标单击不起作用。

我正在使用Firefox 38.0.5。

任何帮助都将不胜感激。

2 个答案:

答案 0 :(得分:3)

为什么您的代码被a-Tag(<a href=""></a>)包围? 如果您点击内容(例如您的下拉列表),则href =“”会重新加载页面。 删除a或将href=""更改为href="#"

答案 1 :(得分:0)

对我来说,改变href =&#34;&#34; to href =&#34;#&#34;还不够。必须完全消除href属性     &LT; a&gt; 足够了:

  1. 使DDL在FF 38.0.5
  2. 中正常工作
  3. 保留链接的CSS类     到&#34; a&#34;在样式表中
相关问题