ScriptTao
ScriptTao
2017-10-31 06:48

e.clientX中的e代表什么

  • 函数
document.onmousemove = function(e){
        //console.log("e.clientX:"+e.clientX);
        //console.log("coolPlay.offsetLeft:"+coolPlay.offsetLeft);
    var leftV = e.clientX - coolPlay.offsetLeft;
        //console.log("coolPlay.offsetLeft:"+coolPlay.offsetLeft);
        //console.log("leftV:"+leftV);
    if(leftV <= 0){
      leftV = 0;
    };
    if(leftV >= coolPlay.offsetWidth){
      leftV = coolPlay.offsetWidth-10;
    };
    cDrag.style.left = leftV+"px";
        //console.log(leftV);
};

};

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐