删除选择列表onmouseover go up up

时间:2015-10-25 02:22:29

标签: html html5

 <select name="sometext" 
    onmouseover="this.size=this.options.length"
    onmouseout="this.size=1"
    onchange="this.size=1">
  <option>text1</option>
  <option>text2</option>

</select>

此选择列表有效,但我希望选项上升而不是关闭!

任何想法?

谢谢!

1 个答案:

答案 0 :(得分:0)

试一试:

<select size="2" style="visibility:hidden;width:1px;max-width:10px;">
  <option>text1</option>
  <option>text2</option>
</select>
<select name="sometext" 
    onmouseover="this.size=this.options.length"
    onmouseout="this.size=1"
    onchange="this.size=1">
  <option>text1</option>
  <option>text2</option></select>

http://jsfiddle.net/pv20hw8L/