写的htc的数据表格

2019-06-03 08:29:39刘景俊

if(typeof(Dline)!="object"){
    var Dragline=document.createElement("DIV")
    Dragline.id="Dline"
    Dragline.style.cssText="width:1px;border-left:1px solid #CCC;display:none;position:absolute"
    body.appendChild(Dragline)
}
obj.onclick=function(){
    var e=event,tr
    var ee=e.srcElement
    if(ee.tagName=="INPUT"){
        tr=ee.parentNode.parentNode
        obj.rows[tr.rowIndex].cells[0].appendChild(focus_img)
    }
}
obj.onmousemove=function(){
    var e=event,tr
    var ee=e.srcElement
    if(ee.tagName=="TD"&&ee.parentNode.rowIndex==0&&ee.cellIndex>0){
        var a=getxy(ee)
        if(event.x<(a[1]+5)||event.x>(a[1]+a[2]-5)){
            body.style.cursor="col-resize"
            objxy=getxy(obj)
        }else{
            body.style.cursor="default"
        }
    }
}
obj.onmousedown=function(){
    var e=event
    var ee=e.srcElement
    var a=getxy(ee)
    if(body.style.cursor=="col-resize"){
        if(event.x<(a[1]+5))
            Dragborder=1
        else if(event.x>(a[1]+a[2]-5))
            Dragborder=2
        else
            Dragborder=0
        DragObj=ee
        $("Dline").style.left=e.x
        $("Dline").style.top=objxy[0]
        $("Dline").style.height=objxy[3]
        $("Dline").style.display=""
    }
}
body.onmousemove=function(){
    if(DragObj!=null){
        $("Dline").style.left=event.x
        body.style.cursor="col-resize"
    }
}
body.onmouseup=function(){