日期:2014-05-17  浏览次数:20626 次

firefox下,select控件怎么大小不固定呢?
左右双向选择列表,
在火狐浏览器中,有一个列表如果为空,高度就会下降一截。这样我点击addAll或者removeAll按钮后,两边的列表高度会不一样,请问是怎么回事啊。
IE和谷歌下都没问题。火狐版本15.0.1



代码:
<td style="border:0px;width:40%;text-align:center">
<select id="selectL" name="from" mutiple="multiple" size="8">
 <option value="">user1</option>
 <option value="">user2</option>
 <option value="">user4</option>
<td align="center" style="border:0px;width:20%">
    <input type="button" id="addAll" value="&gt;&gt;" style="width:50px;"/>
    <input type="button" id="addOne" value="&gt;" style="width:50px;"/>
    <input type="button" id="removeOne" value="&lt;" style="width:50px;"/>
     <input type="button" id="removeAll" value="&lt;&lt;" style="width:50px;"/>
</td>
<td style="border:0px;width:40%;text-align:center">
<select id="selectR" name="to" multiple="multiple" size="8">
   <option value="$from_user.getUid()">user3</option>
</select>
</td>

------解决方案--------------------
你的HTML代码有问题,非法嵌套,或没有结束标签引起的异常问题 ,你看看下面我修改的 

<table>
<tr>
<td style="border:0px;width:40%;text-align:center"> 
<select id="selectL" name="from" mutiple="multiple" size="8">
 <option value="">user1</option>
 <option value="">user2</option>
 <option value="">user4</option>
 </select>
 </td>
<td align="center" style="border:0px;width:20%"> 
    <input type="button" id="addAll" value="&gt;&gt;" style="width:50px;"/>
    <input type="button" id="addOne" value="&gt;" style="width:50px;"/>
    <input type="button" id="removeOne" value="&lt;" style="width:50px;"/>
     <input type="button" id="removeAll" value="&lt;&lt;" style="width:50px;"/>
</td> 
<td style="border:0px;width:40%;text-align:center"> 
    <select id="selectR" name="to" multiple="multiple" size="8">
       <option value="$from_user.getUid()">user3</option>
    </select> 
</td> 
</tr>
</table>


对了,要给满分啊,不能赖的,呵呵
------解决方案--------------------
firefox的问题吧。。定高和宽就好了
<td style="border:0px;width:40%;text-align:center">
<select id="selectL" name="from" mutiple="multiple" size="8" style="height:130px;width:90px;">
 <option value="">user1</option>
 <option value="">user2</option>
 <option value="">user4</option>
<td align="center" style="border:0px;width:20%">
    <input type="button" id="addAll" value="&gt;&gt;" style="width:50px;"/>
   &nbs