爱易网
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 浏览次数:20197 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<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
上一篇:狡猾的按钮特效
下一篇:输入字数的限定
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
黑狐病毒疯传播 电脑管家首推 专杀工具
微信今天大面积崩溃 腾讯:因光缆施工被挖断
百度“全网寻人”面前的互联网信息枢纽价值
200美元英特尔Android笔记本行将到来
P2P平台科迅网疑“跑路” 涉及金额超2700万
电信资费新政:三巨头压力大 短期降价仍有争议
三星起诉LG在冰箱广告中玷污其企业笼统
支付宝全面封杀比特币:充值码淘宝店或遭封禁
评论:阿里为什么不试着收购一家香港媒体呢
推荐阅读
更多>
微软提示XP只剩365天寿命:用户被绑架?
联想架构调整后:Think品牌或推智能手机
墨迹天气:产品创新以攻为守方能对抗巨头
中移动推动感地带3G网聊卡 火拼微信沃卡
阿里国际化再落子:2.49亿美元投资新加坡邮政
赴美开店,阿里11Main准备好了吗?
曹国伟:微博将关注Facebook和Twitter
国美电商开打价钱战 牟贵先言行矛盾受质疑
微软确认 Surface 计划更多尺寸和LTE 版本
在线音乐出现“小米公司”不是没有可能
迅雷向美SEC提交IPO招股书:拟最多筹资1亿美元
微软的云服务显示出他们将自我进化
网曝富士康“二连跳” 疑因推静音模式
中电信国际漫游费下调85% 世界杯上网28元/天
只有切到刚需痛点,漫画APP才能走下去
微信将商场O2O战火烧到了阿里巴巴老家
打车App就是下一个团购骗局!?
三大运营商合建铁塔公司真相:未涉及电信业重组
Twitter收购印度手机营销公司ZipDial
摩托罗拉移动裁员关闭德州Moto X手机工厂