爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
左右内容的选择
左右内容的选择
日期:2014-05-18 浏览次数:20200 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<body>区域中 <SCRIPT LANGUAGE="JavaScript"> <!-- Begin // Compare two options within a list by VALUES function compareOptionValues(a, b) { // Radix 10: for numeric values // Radix 36: for alphanumeric values var sA = parseInt( a.value, 36 ); var sB = parseInt( b.value, 36 ); return sA - sB; } // Compare two options within a list by TEXT function compareOptionText(a, b) { // Radix 10: for numeric values // Radix 36: for alphanumeric values var sA = parseInt( a.text, 36 ); var sB = parseInt( b.text, 36 ); return sA - sB; } // Dual list move function function moveDualList( srcList, destList, moveAll ) { // Do nothing if nothing is selected if ( ( srcList.selectedIndex == -1 ) && ( moveAll == false ) ) { return; } newDestList = new Array( destList.options.length ); var len = 0; for( len = 0; len < destList.options.length; len++ ) { if ( destList.options[ len ] != null ) { newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected ); } } for( var i = 0; i < srcList.options.length; i++ ) { if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) ) { // Statements to perform if option is selected // Incorporate into new list newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected ); len++; } } // Sort out the new destination list newDestList.sort( compareOptionValues ); // BY VALUES //newDestList.sort( compareOptionText ); // BY TEXT // Populate the destination with the items from the new array for ( var j = 0; j < newDestList.length; j++ ) { if ( newDestList[ j ] != null ) { destList.options[ j ] = newDestList[ j ]; } } // Erase source list selected elements for( var i = srcList.options.length - 1; i >= 0; i-- ) { if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) ) { // Erase Source //srcList.options[i].value = ""; //srcList.options[i].text = ""; srcList.options[i] = null; } } } // End of moveDualList() // End --> </script> <form ACTION="" METHOD="POST" name="myForm"> <table border="0"> <tr> <td> <!-- Multiple Select List with 20 rows size and 70 pixels wide --> <!-- Using for SPACING and alignment --> <select multiple size="20" style="width:70" name="listLeft"> <option value="10"> 10 </option> <option value="20"> 20 </option> <option value="30"> 30 </option> <option value="40"> 40 </option> <option value="50"> 50 </option> <option value="A" > A </option> <option value="B" > B </option> <option value="F" > F </option> <option value="X" > X </option> </select> </td> <td><NOBR> <input type="button" style="width:90" onclick="moveDualList( this.form.listLeft, this.form.listRight, false )" name="Add >>" value="Add >>"> <BR> <NOBR> <input type="button" style="width:90" onclick="moveDualList( this.form.listRight, this.form.listLeft, false )" name="Add
上一篇:狡猾的按钮特效
下一篇:输入字数的限定
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
苹果已经允许开发者提交64位应用程序
聚美优品获基石投资1.5亿美金,IPO吃下定心丸
广电总局回应美剧下架:不是所有信息可公开
曹国伟:微博将关注Facebook和Twitter
从旗下三大业务BG发展看华为的过去现在和未来
O2O成"唐僧肉":百度糯米抢食第一口令阿里腾讯颤抖
中国邮政与阿里合作:邮政网点可做网购自提点
Facebook以“人”为本的名义占领安卓
从百度世界大会看大数据
推荐阅读
更多>
微软最后的救命稻草Win 8份额继续上升
高德百度地图免费背后:李彦宏暗斗马云周鸿祎
众贷网满月开张 网络金融监管再受质疑
三星石墨烯制备技术获突破
网络旅行游记被曝插入"软广告" 个别人士月入数万
网易微博将正式关闭 用户迁至轻博客LOFTER
腾讯再次重申:普通微信誉户相对不收费
SAP高层调整:联席CEO孟鼎铭成唯一掌舵人
新浪微博推粉丝头条功能 意欲与大号分成
9月1日起免征新能源汽车购置税
用友软件股价逆势下跌 再融资方案现曙光
眼球识别技术EyeVerify融资600万美元 360参投
京东联席董事长赵国庆上市前夕离职
PC迎9年来出货量新低 平板电脑渐成主流
迪信通神秘免费服务揭谜底:充电宝免费带回家
谷歌欲收买WhatsApp添加砝码 对方否认
用户喊话当当网:我彻底把你们丢弃了
TD是完成中国梦的一个契机
虚拟运营商前路迷茫 业界建议发力车联网
支付宝服务窗后台首曝光 开放用户消费数据