/*
*
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
1
您可能感兴趣的文章: