?? 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 + -