大致分为三个步骤:
鼠标摁下 onmousedown
鼠标移动 onmousemove
鼠标抬起 onmouseup
注意的一点是 onmousemove事件和onmouseup事件是在onmousedown事件里面的
代码如下(不支持IE8及以下浏览器):代码一123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, ...