| | |
| | | that.getMosePosition(that.__xx, that.__yy); |
| | | } |
| | | // console.log(that.__yy, '鼠标'); |
| | | var h = that.__yy - that.__sy; |
| | | var h = that.__yy - that.__sy |
| | | |
| | | if (that.state == 'down') {//两种模式 |
| | | var chous = h >= 0 && h + that.__dy <= that.__wy - 20; |
| | | console.log(that.state); |
| | | if (h >= 0 && h + that.__dy <= that.__wy - 20) { |
| | | that.changeDomPosition(0, h, h + that.__dy);//改变位置 |
| | | } |
| | | } else if (that.state == 'up') { |
| | | var chous = h >= -that.__dy && h <= that.__wy - 20; |
| | | console.log(that.state); |
| | | if (h >= -that.__dy && h <= that.__wy - 20) { |
| | | that.changeDomPosition(0, h, h + that.__wy - 20);//改变位置 |
| | | } |
| | | } |
| | | if (chous) { |
| | | that.changeDomPosition(0, h, h + that.__wy - 20);//改变位置 |
| | | } |
| | | |
| | | }); |
| | | that.div.on('touchend', function () {//抬起重置 |
| | | once = true;//抬起重置鼠标点击位置 |