爱易网
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 浏览次数:20125 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<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
上一篇:狡猾的按钮特效
下一篇:输入字数的限定
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
摩托罗拉移动裁员关闭德州Moto X手机工厂
永不磨灭的九大尖端编程语言
新浪微博推粉丝头条功能 意欲与大号分成
说说这一个月的赌球输了多少
亚马逊落户上海自贸区:美国货直邮中国
墨迹也要做硬件,工具类应用如何“变异”的
IT时代周刊总编辑曹健:投资人刘志硕印象记
苹果CEO抱歉解读:是战略而非“屈服”
虚拟运营市场躁动:山西煤老板兴味浓重
推荐阅读
更多>
曝阿里巴巴一怀孕员工过劳死 加班情况引争议
小米打响手机价格战 为米3铺路或另有所图
雅安地震救灾前线的科技之手 微弱而暖和
京东联席董事长赵国庆上市前夕离职
黑莓高管:黑莓能作为家“小众公司”活下来
创维冲击500亿梦想:转型硬件和内容供应商
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
微软提示XP只剩365天寿命:用户被绑架?
埃里克杰克森:阿里IPO估值至少1500亿美元
中电信率先推移动转售业务 中下旬批量上市
看蜗牛如何放水养鱼,盘活生态系统
中移动将推出多项4G资费新政
联通丹东公司一高管造假套出手机变卖被判刑7年
支付宝曝平安破绽:转账信息被谷歌抓取
阿里巴巴IPO难掩的四个现实问题:天猫销售额成谜、淘宝拖后腿、营收迅猛其他不行和投资者未必买账
完美入股盛大:一桩各怀心事的交易
传三星为赢得新兴市场:推廉价版Note3
二维码支付大战的号角注定已经吹响,尚需标准发放
传诺基亚5月14日发布会推出Lumia 950
广电总局回应美剧下架:不是所有信息可公开