📄 0151.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- saved from url=(0032)http://www.ie-zone.com/index.php --><HTML><HEAD><TITLE>多项目选择脚本</TITLE><META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK href="../../fav.ico" rel="shortcut icon"><STYLE type=text/css>BODY { MARGIN: 25px 25px 25px}#all TD { FONT-SIZE: 14px; LINE-HEIGHT: 15px; FONT-FAMILY: "宋体"}INPUT { FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"}SELECT { FONT-SIZE: 14px; LINE-HEIGHT: 18px; FONT-FAMILY: "宋体"}TEXTAREA { FONT-SIZE: 14px; LINE-HEIGHT: 18px; FONT-FAMILY: "宋体"}#all A:active { COLOR: #7d070c}#all A:visited { COLOR: #7d070c}#all A:hover { COLOR: #336699}#all A:link { COLOR: #7d070c}</STYLE><SCRIPT language=JavaScript><!--function MM_goToURL() { //v3.0 var i, args=MM_goToURL.arguments; document.MM_returnValue = false; for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");}function JM_cc(ob){var obj=MM_findObj(ob); if (obj) { obj.select();js=obj.createTextRange();js.execCommand("Copy");}}function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x;}//--></SCRIPT><META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD><BODY id=all text=#000000 bgColor=#336699><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="../images/sq_1.gif" width=11 height="14"></TD> <TD width="100%"></TD> <TD><IMG src="../images/sq_2.gif" width=11 height="14"></TD> </TR></TABLE><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="../../images/space.gif" width=11 height="1"></TD> <TD width="100%"> <table width="100%" border="0" cellpadding="8"> <tr> <td align="center"> <script language="JavaScript">document.write("<font color=#7d070c style=\"font-size: 14px\">"+document.title+"</font>");</script> </td> </tr> <tr> <td bgcolor="#f7f7f7"><font color="#990000"> <script language="JavaScript">function copyToList(from,to){ fromList = eval('document.forms[0].' + from); toList = eval('document.forms[0].' + to); if (toList.options.length > 0 && toList.options[0].value == 'temp') { toList.options.length = 0; } var sel = false; for (i=0;i<fromList.options.length;i++) { var current = fromList.options[i]; if (current.selected) { sel = true; if (current.value == 'temp') { alert ('你不能选择这个项目!'); return; } txt = current.text; val = current.value; toList.options[toList.length] = new Option(txt,val); fromList.options[i] = null; i--; } } if (!sel) alert ('你还没有选择任何项目');}function allSelect(){ List = document.forms[0].chosen; if (List.length && List.options[0].value == 'temp') return; for (i=0;i<List.length;i++) { List.options[i].selected = true; }}</script> 提示</font>:这是一种常用在进行一些多选操作时使用的脚本,你可能已经见到过了,效果就是你可以在左边的选项中选择你喜欢的,然后添加至右方的喜爱列表.<font color="#990000"> 按Ctrl可同时选择多个项目 </font> <table border="0"> <form onSubmit="allSelect()"> <tr> <td> <select name="possible" size="4" MULTIPLE width=200 style="width: 200px"> <option value="1">中国广州 <option value="2">中国上海 <option value="3">中国北京 <option value="4">中国武汉 </select> </td> <td><a href="javascript:copyToList('possible','chosen')">添加至右方--><br> <br> </a><a href="javascript:copyToList('chosen','possible')"><--添加至左方</a></td> <td> <select name="chosen" size="4" MULTIPLE width=200 style="width: 200px;"> <option value="temp">从左边选择你的地区 </select> </td> </tr> </form> </table> </td> </tr> <tr> <td><img src="imgs/step.gif" width="30" height="30"> 将下面的代码复制到<head> 内 <input type="button" name="Button" value="复制到我的剪贴板" onClick=JM_cc('js_1')> <br> <table width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#dddddd"> <tr> <td></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#f7f7f7"><form name="form1" method="post" action=""> <tr> <td> <textarea name="js_1" wrap="VIRTUAL" cols="80" rows="10"><script language="JavaScript">function copyToList(from,to) //from表示:包含可选择项目的select对象名字 to表示:列出可选择项目的select对象名字 //你可以根据你的具体情况修改{ fromList = eval('document.forms[0].' + from); toList = eval('document.forms[0].' + to); if (toList.options.length > 0 && toList.options[0].value == 'temp') { toList.options.length = 0; } var sel = false; for (i=0;i<fromList.options.length;i++) { var current = fromList.options[i]; if (current.selected) { sel = true; if (current.value == 'temp') { alert ('你不能选择这个项目!'); return; } txt = current.text; val = current.value; toList.options[toList.length] = new Option(txt,val); fromList.options[i] = null; i--; } } if (!sel) alert ('你还没有选择任何项目');}function allSelect() //这是当用户按下提交按钮时,对列出选择的select对象执行全选工作,让递交至的后台程序能取得相关数据{ List = document.forms[0].chosen; if (List.length && List.options[0].value == 'temp') return; for (i=0;i<List.length;i++) { List.options[i].selected = true; }}</script></textarea> </td> </tr> </form> </table> <br> <br> <img src="imgs/step2.gif" width="30" height="30"> 将下面的代码复制到<body> 内 <input type="button" name="Button2" value="复制到我的剪贴板" onClick=JM_cc('js_2')> <br> <table width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#dddddd"> <tr> <td></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="7" bgcolor="#f7f7f7"><form name="form1" method="post" action=""> <tr> <td> <textarea name="js_2" wrap="VIRTUAL" cols="80" rows="10"><table border="0"> <form onSubmit="allSelect()"> <tr> <td> <select name="possible" size="4" MULTIPLE width=200 style="width: 200px"> <option value="1">中国广州 <option value="2">中国上海 <option value="3">中国北京 <option value="4">中国武汉 </select> </td> <td><a href="javascript:copyToList('possible','chosen')">添加至右方--><br> <br> </a><a href="javascript:copyToList('chosen','possible')"><--添加至左方</a></td> <td> <select name="chosen" size="4" MULTIPLE width=200 style="width: 200px;"> <option value="temp">从左边选择你的地区 </select> </td> </tr> </form> </table> </textarea> </td> </tr> </form> </table> <br> <br> </td> </tr> </table> </TD> <TD><IMG src="../../images/space.gif" width=11 height="1"></TD> </TR></TABLE><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#ffffff> <TD><IMG src="../images/sq_3.gif" width=11 height="14"></TD> <TD width="100%"></TD> <TD><IMG src="../images/sq_4.gif" width=11 height="14"></TD> </TR></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -