- 瀏覽大圖時鼠標感應控制層滾動條的移動
< div style="overflow:auto; width:300; height:300" id=a>
< img src="圖片地址" width="800" height="800" onmousemove='a.scrollLeft=event.x*2.5-a.offsetLeft-100;a.scrollTop=event.y*2.5-a.offsetTop-100'>
< /div>
- 用ondrag事件簡單的實現(xiàn)鼠標拖動物件
< script>
//Dhtml:用ondrag事件簡單的實現(xiàn)鼠標拖動物件.
var xx=0,yy=0
< /script>
< img src="圖片地址" style='position:absolute;' ondragstart="setCapture();xx=event.x-this.offsetLeft;yy=event.y-this.offsetTop;" ondrag='this.style.left=event.x-xx;this.style.top=event.y-yy' ondragend="releaseCapture();">