爱易网
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 浏览次数:20223 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<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
上一篇:狡猾的按钮特效
下一篇:输入字数的限定
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
PC迎9年来出货量新低 平板电脑渐成主流
马云自称在美国曾被绑票
世界杯让耐克阿迪大打出手 谁能劈开用户大脑?
北京今日实现用支付宝钱包为公交卡充值
柳传志马云陷舆论漩涡:请不要辜负这个时代
网易云音乐能否为丁磊拿到移动互联网门票?
阿里入股虎嗅:媒体的脊梁弯了?未必!
传诺基亚Lumia928下月推出 将与iPhone5看齐
诺基亚仍是第二大手机商:功用机有利可图
推荐阅读
更多>
美剧讲硅谷创业者:远不及现实荒诞?
联想国庆完成收购IBM x86服务器
小米打响手机价格战 为米3铺路或另有所图
传苹果中移动达成协议:新iPhone兼容TD制式
苏宁双线同价遇难题:第一个吃螃蟹不轻松
“论文查重”网店一月收入竟过百万
苹果6月20日发布iPhone5S 触摸屏概念股生动
Android应用审核乱象:诈骗软件冲上排行榜首
打车App就是下一个团购骗局!?
微软提示XP只剩365天寿命:用户被绑架?
联想架构调整后:Think品牌或推智能手机
Google要求硬件厂商捆绑预装应用的协议曝光
盛大游戏走向衰落的根源:免费游戏模式惹的祸
墨迹天气:产品创新以攻为守方能对抗巨头
网曝富士康500万iphone遭退货是确证的事
携程整合去哪儿陷入僵局 欲联手老对手艺龙
神奇约炮应用被禁 改名后重返苹果应用商店
谷歌新技术进入iOS平台:将叫板苹果Siri
携程艺龙联手死磕同程 价钱烽烟蔓延至机票
三星手机在国内陷入困境:华为中兴小米紧追