富贵资源网 Design By www.hznty.com
tableSort.class.js
复制代码 代码如下:
/*
* 表格名不能为空,可为已获取的对象或名字
* 表头名默认为:tag
* 通过自行编写接口可实现不同的触发排序方式
*
* 作者:Auntion
* E-mail:Auntion@Gmail.com
* OICQ:82874972
*
* 日期:2007年04月22日 - 测试 - 待修正
*/
var tableSort= function(element,tagName,upStyle,downStyle){this.table= (typeof(element) == 'string') ? TAGDom.fromId(element) : element;this.td = this.table.getElementsByTagName("td"); this.hName= (tagName.length<1) ? "tag" : tagName;this.rows = this.table.rows;this.byUp = (upStyle == undefined) ? "DescUp" : upStyle ;this.byDown = (downStyle == undefined) ? "DescDown" : downStyle ;var totalTd = [];var totalNr = [];var totalTag= [];this.tempCellIndex; this.tempStatus = {};var setAllTag = function(){ for(var i = 0; i < this.td.length; i++){if(this.td[i].className === this.hName) totalTag.push(this.td[i]);}}.bind(this);var getStatus = function(tagName){this.tempStatus[tagName] = (this.tempStatus[tagName] == true) ? false : true;for(tags in this.tempStatus){if(tags == tagName) return this.tempStatus[tags];else delete this.tempStatus[tags];}}.bind(this);var changeShow = function(cellIn,status){for(var i=0; i<totalTag.length; i++){if(totalTag[i].cellIndex == cellIn){if(status == true) totalTag[i].className = this.byUp;else if(status == false) totalTag[i].className = this.byDown;}else{totalTag[i].className = this.hName;}}}.bind(this);var startSort = function(status){for (var i = totalNr[this.tempCellIndex].length - 1; i > 0; i--){for (var j = 0; j < i; ++j){if ( (status == true) ? totalNr[this.tempCellIndex][j] > totalNr[this.tempCellIndex][j + 1] : totalNr[this.tempCellIndex][j] < totalNr[this.tempCellIndex][j + 1] ){var temp = totalNr[this.tempCellIndex][j + 1];totalNr[this.tempCellIndex][j + 1] = totalNr[this.tempCellIndex][j];totalNr[this.tempCellIndex][j] = temp;for(var n=0; n<totalNr.length; n++){if(n != this.tempCellIndex){var temps = totalNr[n][j+1];totalNr[n][j + 1] = totalNr[n][j];totalNr[n][j] = temps;}}}}};InsertContect();}.bind(this);var InsertContect = function(){ for(var i=0; i<totalTd.length; i++){for(var j=0; j<totalTd[i].length; j++){totalTd[i][j].innerHTML = totalNr[i][j];}};totalTd.length = 0;totalNr.length = 0;};this.init = function(status){for(var i=0; i<(this.td.length/this.rows.length); i++){totalTd[i] = new Array();totalNr[i] = new Array();for(var j=0; j<this.rows.length; j++){if(this.rows[j].cells[i].className !== this.hName){totalTd[i][j-1] = this.rows[j].cells[i];if(IsNumber(this.rows[j].cells[i].innerHTML) == true){totalNr[i][j-1] = parseInt(this.rows[j].cells[i].innerHTML);}else{totalNr[i][j-1] = this.rows[j].cells[i].innerHTML;}}}}startSort(status);}
/********************************************************************************************************************************/
/**通过点击标签触发排序事件**/
//public: 通过默认鼠标事键触发 (interface example)(设置用户接口的范例)
this.toTagStart = function(){
setAllTag(); //获取标签
for(var i=0; i<totalTag.length; i++){
totalTag[i].sIndex = function(cIndex){ this.tempCellIndex=cIndex }.bind(this); //设置列index
totalTag[i].gStatus = function(values){ return getStatus(values) }; //获取与设置状态
totalTag[i].ceShow = function(i,s){ changeShow(i,s) }; //改变显示的东西
totalTag[i].stSort = function(status){ this.init(status) }.bind(this); //初始化
totalTag[i].onselectstart = function(){ return false }; //点击不选中文字
totalTag[i].onclick = function(){
this.sIndex(this.cellIndex);
this.status = this.gStatus(this.firstChild.nodeValue);
this.ceShow(this.cellIndex,this.status);
this.stSort(this.status);
}
}
}
}
Language.ext.js
复制代码 代码如下:
/*
*
By Auntion
QQ:82874972
Blog:Auntion@blogbus.com
Email:Auntion@Gmail.com
请勿删除此部分注释.谢谢!
ver date-2007-02-01
*
*/
var isIe = /msie/i.test(navigator.userAgent);
var TAGDom = {
fromId: function(i){
return document.getElementById(i);
},
fromName: function(i){
return document.getElementById(i);
},
fromClass: function(className,baseId) {
this.fatherId = null;
if(!baseId){
this.fatherId = document;
}else{
this.fatherId = DOM.fromId(baseId);
}
var basic = fatherId.getElementsByTagName("*") || document.all;
var child = null;
var classNames = null;
var aggregate = [];
for (var i = 0; i < basic.length; i++) {
child = basic[i];
classNames = child.className.split(" ");
for (var j = 0; j < classNames.length; j++) {
if (classNames[j] == className) {
aggregate.push(child);
break;
}
}
}
return aggregate;
}
};
function externalStyle (element, target) {
this.setReturn;
if (element.currentStyle){
this.setReturn = element.currentStyle[target];
}else if (window.getComputedStyle){
this.setReturn = getComputedStyle (element,"").getPropertyValue(target);
}
return this.setReturn;
}
String.prototype.toInt = function(){
return parseInt(this.replace(/[a-zA-Z]+/,''));
}
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}
Function.prototype.bind = function(e) {
var source = this;
return function() {
return source.apply(e,arguments);
}
}
function IsNumber(_str){
var tmp_str = _str.trim();
var pattern = /^(- ¦\+)?\d+(\d+)?$/;
return pattern.test(tmp_str);
}
使用实例_1.htm
12下一页阅读全文
复制代码 代码如下:
/*
* 表格名不能为空,可为已获取的对象或名字
* 表头名默认为:tag
* 通过自行编写接口可实现不同的触发排序方式
*
* 作者:Auntion
* E-mail:Auntion@Gmail.com
* OICQ:82874972
*
* 日期:2007年04月22日 - 测试 - 待修正
*/
var tableSort= function(element,tagName,upStyle,downStyle){this.table= (typeof(element) == 'string') ? TAGDom.fromId(element) : element;this.td = this.table.getElementsByTagName("td"); this.hName= (tagName.length<1) ? "tag" : tagName;this.rows = this.table.rows;this.byUp = (upStyle == undefined) ? "DescUp" : upStyle ;this.byDown = (downStyle == undefined) ? "DescDown" : downStyle ;var totalTd = [];var totalNr = [];var totalTag= [];this.tempCellIndex; this.tempStatus = {};var setAllTag = function(){ for(var i = 0; i < this.td.length; i++){if(this.td[i].className === this.hName) totalTag.push(this.td[i]);}}.bind(this);var getStatus = function(tagName){this.tempStatus[tagName] = (this.tempStatus[tagName] == true) ? false : true;for(tags in this.tempStatus){if(tags == tagName) return this.tempStatus[tags];else delete this.tempStatus[tags];}}.bind(this);var changeShow = function(cellIn,status){for(var i=0; i<totalTag.length; i++){if(totalTag[i].cellIndex == cellIn){if(status == true) totalTag[i].className = this.byUp;else if(status == false) totalTag[i].className = this.byDown;}else{totalTag[i].className = this.hName;}}}.bind(this);var startSort = function(status){for (var i = totalNr[this.tempCellIndex].length - 1; i > 0; i--){for (var j = 0; j < i; ++j){if ( (status == true) ? totalNr[this.tempCellIndex][j] > totalNr[this.tempCellIndex][j + 1] : totalNr[this.tempCellIndex][j] < totalNr[this.tempCellIndex][j + 1] ){var temp = totalNr[this.tempCellIndex][j + 1];totalNr[this.tempCellIndex][j + 1] = totalNr[this.tempCellIndex][j];totalNr[this.tempCellIndex][j] = temp;for(var n=0; n<totalNr.length; n++){if(n != this.tempCellIndex){var temps = totalNr[n][j+1];totalNr[n][j + 1] = totalNr[n][j];totalNr[n][j] = temps;}}}}};InsertContect();}.bind(this);var InsertContect = function(){ for(var i=0; i<totalTd.length; i++){for(var j=0; j<totalTd[i].length; j++){totalTd[i][j].innerHTML = totalNr[i][j];}};totalTd.length = 0;totalNr.length = 0;};this.init = function(status){for(var i=0; i<(this.td.length/this.rows.length); i++){totalTd[i] = new Array();totalNr[i] = new Array();for(var j=0; j<this.rows.length; j++){if(this.rows[j].cells[i].className !== this.hName){totalTd[i][j-1] = this.rows[j].cells[i];if(IsNumber(this.rows[j].cells[i].innerHTML) == true){totalNr[i][j-1] = parseInt(this.rows[j].cells[i].innerHTML);}else{totalNr[i][j-1] = this.rows[j].cells[i].innerHTML;}}}}startSort(status);}
/********************************************************************************************************************************/
/**通过点击标签触发排序事件**/
//public: 通过默认鼠标事键触发 (interface example)(设置用户接口的范例)
this.toTagStart = function(){
setAllTag(); //获取标签
for(var i=0; i<totalTag.length; i++){
totalTag[i].sIndex = function(cIndex){ this.tempCellIndex=cIndex }.bind(this); //设置列index
totalTag[i].gStatus = function(values){ return getStatus(values) }; //获取与设置状态
totalTag[i].ceShow = function(i,s){ changeShow(i,s) }; //改变显示的东西
totalTag[i].stSort = function(status){ this.init(status) }.bind(this); //初始化
totalTag[i].onselectstart = function(){ return false }; //点击不选中文字
totalTag[i].onclick = function(){
this.sIndex(this.cellIndex);
this.status = this.gStatus(this.firstChild.nodeValue);
this.ceShow(this.cellIndex,this.status);
this.stSort(this.status);
}
}
}
}
Language.ext.js
复制代码 代码如下:
/*
*
By Auntion
QQ:82874972
Blog:Auntion@blogbus.com
Email:Auntion@Gmail.com
请勿删除此部分注释.谢谢!
ver date-2007-02-01
*
*/
var isIe = /msie/i.test(navigator.userAgent);
var TAGDom = {
fromId: function(i){
return document.getElementById(i);
},
fromName: function(i){
return document.getElementById(i);
},
fromClass: function(className,baseId) {
this.fatherId = null;
if(!baseId){
this.fatherId = document;
}else{
this.fatherId = DOM.fromId(baseId);
}
var basic = fatherId.getElementsByTagName("*") || document.all;
var child = null;
var classNames = null;
var aggregate = [];
for (var i = 0; i < basic.length; i++) {
child = basic[i];
classNames = child.className.split(" ");
for (var j = 0; j < classNames.length; j++) {
if (classNames[j] == className) {
aggregate.push(child);
break;
}
}
}
return aggregate;
}
};
function externalStyle (element, target) {
this.setReturn;
if (element.currentStyle){
this.setReturn = element.currentStyle[target];
}else if (window.getComputedStyle){
this.setReturn = getComputedStyle (element,"").getPropertyValue(target);
}
return this.setReturn;
}
String.prototype.toInt = function(){
return parseInt(this.replace(/[a-zA-Z]+/,''));
}
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}
Function.prototype.bind = function(e) {
var source = this;
return function() {
return source.apply(e,arguments);
}
}
function IsNumber(_str){
var tmp_str = _str.trim();
var pattern = /^(- ¦\+)?\d+(\d+)?$/;
return pattern.test(tmp_str);
}
使用实例_1.htm
12下一页阅读全文
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com
暂无评论...
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。