Advertisement
Guest User

Untitled

a guest
May 21st, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. //Make the DIV element draggagle:
  2. dragElement(document.getElementById(("mydiv")));
  3.  
  4. function dragElement(elmnt) {
  5. var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
  6. if (document.getElementById(elmnt.id + "header")) {
  7. /* if present, the header is where you move the DIV from:*/
  8. document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
  9. } else {
  10. /* otherwise, move the DIV from anywhere inside the DIV:*/
  11. elmnt.onmousedown = dragMouseDown;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement