var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;//测试
//if (Sys.ie) alert('IE: ' + Sys.ie);
//if (Sys.firefox) alert('Firefox: ' + Sys.firefox);
//if (Sys.chrome) alert('Chrome: ' + Sys.chrome);
//if (Sys.opera) alert('Opera: ' + Sys.opera);
//if (Sys.safari) alert('Safari: ' + Sys.safari);//基本函数if (typeof HTMLElement != "undefined" && !HTMLElement.prototype.insertAdjacentElement) {
    HTMLElement.prototype.insertAdjacentHTML = function(where, html) {
        var e = this.ownerDocument.createRange();
        e.setStartBefore(this);
        e = e.createContextualFragment(html);
        switch (where) {
            case 'beforeBegin': this.parentNode.insertBefore(e, this); break;
            case 'afterBegin': this.insertBefore(e, this.firstChild); break;
            case 'beforeEnd': this.appendChild(e); break;
            case 'afterEnd':
                if (!this.nextSibling) this.parentNode.appendChild(e);
                else this.parentNode.insertBefore(e, this.nextSibling); break;
        }
    };    HTMLElement.prototype.insertAdjacentElement = function(where, parsedNode) {
        switch (where) {
            case "beforeBegin": this.parentNode.insertBefore(parsedNode, this); break;
            case "afterBegin": this.insertBefore(parsedNode, this.firstChild); break;
            case "beforeEnd": this.appendChild(parsedNode); break;
            case "afterEnd":
                if (this.nextSibling) this.parentNode.insertBefore(parsedNode, this.nextSibling);
                else this.parentNode.appendChild(parsedNode); break;
        }
    };}//得到对象坐标
function objxy(obj) {
    var tx = 0, ty = 0, tw = 0, th = 0, tobj = obj;
    tw = parseFloat(obj.offsetWidth);
    th = parseFloat(obj.offsetHeight);
    while (tobj) {
        tx += tobj.offsetLeft;
        ty += tobj.offsetTop;
        tobj = tobj.offsetParent;
    }
    return [tx, ty, tw, th];
}//得到鼠标坐标
function mousexy(ev) {
    ev = ev || window.event;
    if (ev.pageX || ev.pageY) {
        return { x: ev.pageX, y: ev.pageY };
    }
    return {
        x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,
        y: ev.clientY + document.body.scrollTop - document.body.clientTop
    };
}/*
固定表头
czz
2009-09-21
*/
function FixHeadTable(fid) {
    var FixContent = this;
    this.Id = fid;    this.FContent = document.getElementById(fid);
    this.FHead = document.getElementById(fid + "_head");
    this.FBody = document.getElementById(fid + "_body");
    
    this.FBody.onscroll = function() {
        FixContent.FHead.scrollLeft = FixContent.FBody.scrollLeft;
    }
}
//重设表格长宽
FixHeadTable.prototype.SetSize = function(w, h) {    this.FContent.style.width = w + "px";
    this.FContent.style.height = h + "px";    this.FBody.style.width = w + "px";
    this.FBody.style.height = h + "px";
    //判断滚动条
    if (parseFloat(this.FBody.scrollHeight) > parseFloat(this.FBody.offsetHeight)) {
        this.FHead.style.width = (w - 17) + "px";
    }
    else {
        this.FHead.style.width = w + "px";
    }    //设置滚动条与合计
    this.RefreshLayout();    this.FContent.style.visibility = "visible";}
//自动设表格长宽
FixHeadTable.prototype.SetAutoSize = function() {
    var ContentParent = this.FContent.parentNode != null ? this.FContent.parentNode : this.FContent.parentElement;    var w = ContentParent.offsetWidth - (ContentParent.style.borderLeftWidth != "" ? parseFloat(ContentParent.style.borderLeftWidth) : 0) - (ContentParent.style.borderRightWidth != "" ? parseFloat(ContentParent.style.borderRightWidth) : 0) - (ContentParent.style.marginLeft != "" ? parseFloat(ContentParent.style.marginLeft) : 0) - (ContentParent.style.marginRight != "" ? parseFloat(ContentParent.style.marginRight) : 0) - (ContentParent.style.paddingLeft != "" ? parseFloat(ContentParent.style.paddingLeft) : 0) - (ContentParent.style.paddingRight != "" ? parseFloat(ContentParent.style.paddingRight) : 0);
    var h = ContentParent.offsetHeight - (ContentParent.style.borderTopWidth != "" ? parseFloat(ContentParent.style.borderTopWidth) : 0) - (ContentParent.style.borderBottomWidth != "" ? parseFloat(ContentParent.style.borderBottomWidth) : 0) - (ContentParent.style.marginTop != "" ? parseFloat(ContentParent.style.marginTop) : 0) - (ContentParent.style.marginBottom != "" ? parseFloat(ContentParent.style.marginBottom) : 0) - (ContentParent.style.paddingTop != "" ? parseFloat(ContentParent.style.paddingTop) : 0) - (ContentParent.style.paddingBottom != "" ? parseFloat(ContentParent.style.paddingBottom) : 0);    w = w - 5;
    h = h - 5;    this.SetSize(w, h);}
//刷新报局
FixHeadTable.prototype.RefreshLayout = function() {
    //对IE7特别处理
    if (parseFloat(this.FBody.scrollWidth) <= parseFloat(this.FBody.offsetWidth)) {
        this.FBody.style.overflowX = "hidden";
    }
    else {
        this.FBody.style.overflowX = "auto";
    }
}
//设置单完格宽度
FixHeadTable.prototype.SetColSize = function(idx, w) {
    this.FHead.getElementsByTagName("table")[0].rows[0].cells[idx].style.width = w + "px";
    this.FBody.getElementsByTagName("table")[0].rows[0].cells[idx].style.width = w + "px";
}/*
调整列
czz
2009-09-21
*/
function AdjustCols(FixTableObj) {    this.Id = FixTableObj.Id + "_stick";
    this.TId = FixTableObj.Id + "_title";
    this.TSId = this.TId + "_split";
    this.FixTable = FixTableObj;这里是一半代码~还有一半没发出来请教高手把这些代码全部用jq重写一次,并部分修改。
有意搞定的联系我QQ:420822072,我将把余下代码发给你。RMB 50.有没有人做?