you can use mousemove event from javascript ,change control's style property

解决方案 »

  1.   

    <html><head>
    <style>
    .drag{position:relative;cursor:hand}
    </style>
    <script language="JavaScript">
    var dragapproved=false
    var z,x,y
    function move(){
    if (event.button==1&&dragapproved){
    z.style.pixelLeft=temp1+event.clientX-x
    return false}}
    function drags(){
    if (!document.all)
    return
    if (event.srcElement.className=="drag"){
    dragapproved=true
    z=event.srcElement
    temp1=z.style.pixelLeft
    x=event.clientX
    y=event.clientY
    document.onmousemove=move}}
    document.onmousedown=drags
    document.onmouseup=new Function("dragapproved=false")
    </script></head><body>
    <input type="text" class="drag">
    </body></html>//主要为控件加上class="drag"的属性,都可以移动