有代码: function move() {
var sel = document.getElementById("List");
if (sel.options.length > 0 && sel.selectedIndex != -1) {
var node = sel.options[sel.selectedIndex];
var nextNode;
if (sel.selectedIndex == 0)
nextNode = null;
else
nextNode = sel.options[sel.selectedIndex - 1];
if (nextNode) node.swapNode(nextNode); //移动
}
}
<select size="2" style="height: 203px; width: 309px" id="List" multiple="multiple">
<option>a</option>
<option>b</option>
</select>
<input type="button" value="up" onclick="move()">在IE9中,当选中list的第二项时,点"up"按钮,会发现b项要很久时间才能移到前一个位置。如果去掉 multiple="multiple",则移动速度很快。大家有没遇到过这情况?
var sel = document.getElementById("List");
if (sel.options.length > 0 && sel.selectedIndex != -1) {
var node = sel.options[sel.selectedIndex];
var nextNode;
if (sel.selectedIndex == 0)
nextNode = null;
else
nextNode = sel.options[sel.selectedIndex - 1];
if (nextNode) node.swapNode(nextNode); //移动
}
}
<select size="2" style="height: 203px; width: 309px" id="List" multiple="multiple">
<option>a</option>
<option>b</option>
</select>
<input type="button" value="up" onclick="move()">在IE9中,当选中list的第二项时,点"up"按钮,会发现b项要很久时间才能移到前一个位置。如果去掉 multiple="multiple",则移动速度很快。大家有没遇到过这情况?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货