爱易网
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 浏览次数:20231 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>爱易网网页特效演示,非常不错的表格排序</title> </head> <STYLE type=text/css>TABLE { BORDER-RIGHT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-BOTTOM: #000000 2px solid; border-spacing: 0px; cell-spacing: 0px } TD { PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; FONT-SIZE: 10pt; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Arial, Helvetica, sans-serif; WHITE-SPACE: nowrap } TH { PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; FONT-SIZE: 10pt; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; FONT-FAMILY: Arial, Helvetica, sans-serif; WHITE-SPACE: nowrap } TD.numeric { TEXT-ALIGN: right } TH { BACKGROUND-COLOR: #c0c0c0 } TH.mainHeader { COLOR: #ffffff; BACKGROUND-COLOR: #808080; TEXT-ALIGN: left } TH A { COLOR: #000080; TEXT-DECORATION: none } TH A:visited { COLOR: #000080 } TH A:active { COLOR: #800000; TEXT-DECORATION: underline } TH A:hover { COLOR: #800000; TEXT-DECORATION: underline } TR.alternateRow { BACKGROUND-COLOR: #e0e0e0 } TD.sortedColumn { BACKGROUND-COLOR: #f0f0f0 } TH.sortedColumn { BACKGROUND-COLOR: #b0b0b0 } TR.alternateRow TD.sortedColumn { BACKGROUND-COLOR: #d0d0d0 } </STYLE> <SCRIPT type=text/javascript> //----------------------------------------------------------------------------- // sortTable(id, col, rev) // // id - ID of the TABLE, TBODY, THEAD or TFOOT element to be sorted. // col - Index of the column to sort, 0 = first column, 1 = second column, // etc. // rev - If true, the column is sorted in reverse (descending) order // initially. // // Note: the team name column (index 1) is used as a secondary sort column and // always sorted in ascending order. //----------------------------------------------------------------------------- function sortTable(id, col, rev) { // Get the table or table section to sort. var tblEl = document.getElementById(id); // The first time this function is called for a given table, set up an // array of reverse sort flags. if (tblEl.reverseSort == null) { tblEl.reverseSort = new Array(); // Also, assume the team name column is initially sorted. tblEl.lastColumn = 1; } // If this column has not been sorted before, set the initial sort direction. if (tblEl.reverseSort[col] == null) tblEl.reverseSort[col] = rev; // If this column was the last one sorted, reverse its sort direction. if (col == tblEl.lastColumn) tblEl.reverseSort[col] = !tblEl.reverseSort[col]; // Remember this column as the last one sorted. tblEl.lastColumn = col; // Set the table display style to "none" - necessary for Netscape 6 // browsers. var oldDsply = tblEl.style.display; tblEl.style.display = "none"; // Sort the rows based on the content of the specified column using a // selection sort. var tmpEl; var i, j; var minVal, minIdx; var testVal; var cmp; for (i = 0; i < tblEl.rows.length - 1; i++) { // Assume the current row has the minimum value. minIdx = i; minVal = getTextValue(tblEl.rows[i].cells[col]); // Search the rows that follow the current one for a smaller value. for (j = i + 1; j < tblEl.rows.length; j++) { testVal = getTextValue(tblEl.rows[j].cells[col]); cmp = compareValues(minVal, testVal); // Negate the comparison result if the reverse sort flag is set. if (tblEl.reverseSort[col]) cmp = -cmp; // Sort by the second column (team name) if those values are equal. if (cmp == 0 && col != 1) cmp = compareValues(getTextValue(tblEl.rows[minIdx].cells[1]), getTe
上一篇:狡猾的按钮特效
下一篇:JavaScript容错脚本
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
HTC以品牌营销突围 专家建议改变经营思路
三星起诉LG在冰箱广告中玷污其企业笼统
评论:马云的成功建立在什么基础上很值得怀疑
易信工具性优势突出 丁磊三板斧或先砍在飞信上
新浪微博推粉丝头条功能 意欲与大号分成
十亿美元的告别礼:三星为何要大举重组?
SAP高层调整:联席CEO孟鼎铭成唯一掌舵人
充斥着假消息负能量的“秘密”缺乏普适性
华为变阵:任正非调整三大业务布局
推荐阅读
更多>
众贷网满月开张 网络金融监管再受质疑
诺基亚再缩阵线 封锁上海旗舰店全力蜕变
传4G牌照国庆节前后发放 TD-LTE制式优先
中电信率先推移动转售业务 中下旬批量上市
去看看外面的世界吧!别窝里斗了,中国在线旅游商们
小灵通两年都无信号 顾客起诉联通公司
小米发明的“低价抢购”模式还能管用多久?
孙正义入股阿里往事还原:阿里巴巴并非软银首选
聚美优品获基石投资1.5亿美金,IPO吃下定心丸
京东封杀财付通:终极目标是电商生态圈
云储存有多远:跨过数据安全问题即可到达
小微型IDC云化趋势加剧 云计算未来或现终极模式
成本效益全兼顾 混合云市场前景显现
优酷土豆兼并一年:依然处于烧钱形状
携程收买酷讯成定局:转型互联网+投资
历史惊人相似:如今的库克 曾经的鲍尔默
云智慧:用大数据实现企业应用性能管理
iPhone 6将于10月17日内地上市:售5288元起
传三星为赢得新兴市场:推廉价版Note3
Line风靡亚洲,在北美却进展缓慢