複製程式碼 程式碼如下: list测试 注1:左右移动进行选取 注:本页面仅在IE6/FireFox1.5下测试过。其它浏览器或其它版本未经测试。 multiple="multiple" ondblclick="moveLeftOrRight(document.frm.SrcSelect,document.frm.ObjSelect) "> 讲师 multiple="multiple" ondblclick="moveLeftOrRight(document.frm.ObjSelect,document.frm.SrcSelect) "> 教学管理员 超级管理员 <br>//上移<br> function moveUp() {<br> var theObjOptions = document.frm.ObjSelect.options;<br> for (var i = 1; i < theObjOptions.length; i++) {<BR> if (theObjOptions[i].selected && !theObjOptions[i - 1].selected) {<BR> swapOptionProperties(theObjOptions[i], theObjOptions[i - 1]);<BR> }<BR> }<BR> }</P> <P><BR>//下移<BR> function moveDown() {<BR> var theObjOptions = document.frm.ObjSelect.options;<BR> for (var i = theObjOptions.length - 2; i > -1; i--) {<br> if (theObjOptions[i].selected && !theObjOptions[i + 1].selected) {<br> swapOptionProperties(theObjOptions[i], theObjOptions[i + 1]);<br> }<br> }<br> }<p><br> function swapOptionProperties(option1, option2) {<br> var tempStr = option1.value option1.value = tempStr;<br> tempStr = option1 .text;<br> option1.text = option2.text;<br> option2.text = tempStr; option2.selected = tempStr;<br> }<br> <br><br>//列錶框的位置移動<br> function moveLeftOrRight(fromObj, toObj) {</p> var srcOption = fromObj .options[i];<p> i--;<br> }<br> > 腳本<br><br><br></p> </div>