Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Make the DIV element draggagle:
- dragElement(document.getElementById(("mydiv")));
- function dragElement(elmnt) {
- var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
- if (document.getElementById(elmnt.id + "header")) {
- /* if present, the header is where you move the DIV from:*/
- document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
- } else {
- /* otherwise, move the DIV from anywhere inside the DIV:*/
- elmnt.onmousedown = dragMouseDown;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement