首页 > 其他 > 详细

图片拖拽的继承,引用 3

时间:2017-09-01 20:59:53      阅读:300      评论:0      收藏:0      [点我收藏+]
//LimitDrag.js


LimitDrag.prototype.fnMove=function(ev){
    var oEvent=ev||event;
    var L= oEvent.clientX-this.disX
    var T= oEvent.clientY-this.disY
    if(L<0){
        L=0
    }
    else if(L>document.documentElement.clientWidth-this.oDiv.offsetWidth){
        L=document.documentElement.clientWidth-this.oDiv.offsetWidth
    }
    if(T<0){
        T=0
    }
    else if(T>document.documentElement.clientHeight-this.oDiv.offsetHeight){
        T=document.documentElement.clientHeight-this.oDiv.offsetHeight
    }
    this.oDiv.style.left=L+‘px‘;
    this.oDiv.style.top=T+‘px‘;
}

 

图片拖拽的继承,引用 3

原文:http://www.cnblogs.com/mylove0/p/7465042.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!