jquery - Dragable DIV using javascript -


i want make dragable div know can done using jquery plug in don't want use because need dragable function. tell me how can make dragable function have did this

$(document).ready(function(e){                 $("#eve").mousemove(function(e){                     var p=$(this);                     var offset = p.offset();                     var ol=offset.left;                     var ot=offset.top;                     var l=e.pagex-ol;                     var t=e.pagey-ot;                     var ex=e.pagex;                     var ey=e.pagey;                     var htm="left:"+ol+" top:"+ot+"<br/>";                     htm+="ex:"+ex+" ey:"+ey+"<br/>";                     htm+="curx:"+l+" cury:"+t+"<br/>";                     htm+="l:"+(ol-l)+" t:"+(ot-t);                     p.html(htm);                    p.css({left:((ex-3))+"px",top:((ey-3))+"px"});                 }); 

you need define multiple function handle mousedown event start drag, mouseup stop draging, , appropriate mousemove handle movements while dragging, check gist found https://gist.github.com/1330150


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -