摘要: js拖动效果原理 主要思路是鼠标按下,鼠标按下并移动,鼠标松开。以上步骤对应的JS事件就是onmousedown,onmousemove,onmouseup。实现代码 function dragElement(id) { this.dom = document.getElementById(id); this.isMouseDown = false; this.pos = null; } dragElement.prototype = { init: functi... 阅读全文
posted @ 2011-07-17 21:48 忧忧夏天 阅读(744) 评论(5) 推荐(1) 编辑