复制代码 代码如下:
<html>
<head>
<meta http-equiv="Content-Type " content="text/html; charset=gb2312 ">
<title>list测试</title>
</head>
<body>
<div style="font-size: 10pt;">
注1:左右移动进行选取
<br />
<br />
注:本页面仅在IE6/FireFox1.5下测试过。其它浏览器或其它版本未经测试。
<br />
<hr />
</div>
<form name="frm">
<table>
<tr>
<td>
<select name="SrcSelect" size="6" style="font-size: 11pt; width: 160px; height: 160px"
multiple="multiple" ondblclick="moveLeftOrRight(document.frm.SrcSelect,document.frm.ObjSelect) ">
<option value="1">讲师</option>
</select>
</td>
<td width="30px">
<input align="left" type="button" value="> " onclick="moveLeftOrRight(document.frm.SrcSelect,document.frm.ObjSelect) ">
<br>
<br>
<input align="left" type="button" value=" < " onclick="moveLeftOrRight(document.frm.ObjSelect,document.frm.SrcSelect) ">
</td>
<td>
<select name="ObjSelect" size="6" style="font-size: 11pt; width: 160px; height: 160px"
multiple="multiple" ondblclick="moveLeftOrRight(document.frm.ObjSelect,document.frm.SrcSelect) ">
<option value="2">教学管理员</option>
<option value="3">超级管理员</option>
</select>
</td>
</tr>
</table>
</form>
</body>
<script type="text/javascript" language="javascript">
//上移
function moveUp() {
var theObjOptions = document.frm.ObjSelect.options;
for (var i = 1; i < theObjOptions.length; i++) {
if (theObjOptions[i].selected && !theObjOptions[i - 1].selected) {
swapOptionProperties(theObjOptions[i], theObjOptions[i - 1]);
}
}
}
//下移
function moveDown() {
var theObjOptions = document.frm.ObjSelect.options;
for (var i = theObjOptions.length - 2; i > -1; i--) {
if (theObjOptions[i].selected && !theObjOptions[i + 1].selected) {
swapOptionProperties(theObjOptions[i], theObjOptions[i + 1]);
}
}
}
function swapOptionProperties(option1, option2) {
var tempStr = option1.value;
option1.value = option2.value;
option1.value = tempStr;
tempStr = option1.text;
option1.text = option2.text;
option2.text = tempStr;
tempStr = option1.selected;
option1.selected = option2.selected;
option2.selected = tempStr;
}
//列表框的位置移动
function moveLeftOrRight(fromObj, toObj) {
for (var i = 0; i < fromObj.length; i++) {
var srcOption = fromObj.options[i];
if (srcOption.selected) {
toObj.appendChild(srcOption);
i--;
}
}
}
</script>
ListBox,多选
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 杨泰瑞《City Boy》[320K/MP3][28.71MB]
- 胡彦斌《失业情歌》首版[WAV+CUE]
- 杨泰瑞《City Boy》[FLAC/分轨][159.66MB]
- APM亚流新世代《一起冒险》[320K/MP3][68.66MB]
- FIM《天伦乐》(DaydreamsAndLullabies)24K金碟[WAV+CUE]
- 【雨果唱片】中国管弦乐《鹿回头》
- 【雨果唱片】中国管弦乐《鹿回头》WAV
- APM亚流新世代《一起冒险》[FLAC/分轨][106.77MB]
- 崔健《飞狗》律冻文化[WAV+CUE][1.1G]
- 罗志祥《舞状元 (Explicit)》[320K/MP3][66.77MB]
- 尤雅.1997-幽雅精粹2CD【南方】【WAV+CUE】
- 张惠妹.2007-STAR(引进版)【EMI百代】【WAV+CUE】
- 群星.2008-LOVE情歌集VOL.8【正东】【WAV+CUE】
- 罗志祥《舞状元 (Explicit)》[FLAC/分轨][360.76MB]
- Tank《我不伟大,至少我能改变我。》[320K/MP3][160.41MB]