Community discussion forum
check my code...how drag the controls like our toolbox control dragging
Last post was 10 Jan 2009 at 09:00
-
in my page having some control(Images) in left side..when i drag any control the copy of control adding into right sidetag..like controls dragging from toolbox.. this is my forst step 2-->After adding the controls intotag ..select any control i need to display selection handlers and move this control around theLocation.. selection Handler means when u select any control at design time it display handlers around the control like this..i want to my controls.. ********************************* This is my code *********************************** <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default6.aspx.vb" Inherits="Default6" %>
Drag and drop in website using javascript <%-- --%> ************************************************* This is my javascript code for moving the control (Drag.js) **************************************************** var DragHandler = { // private property. _oElem : null, // public method. Attach drag handler to an element. attach : function(oElem) { oElem.onmousedown = DragHandler._dragBegin; // callbacks oElem.dragBegin = new Function(); oElem.drag = new Function(); oElem.dragEnd = new Function(); return oElem; }, // private method. Begin drag process. _dragBegin : function(e) { var oElem = DragHandler._oElem = this; if (isNaN(parseInt(oElem.style.left))) { oElem.style.left = '0px'; } if (isNaN(parseInt(oElem.style.top))) { oElem.style.top = '0px'; } var x = parseInt(oElem.style.left); var y = parseInt(oElem.style.top); e = e ? e : window.event; oElem.mouseX = e.clientX; oElem.mouseY = e.clientY; oElem.dragBegin(oElem, x, y); document.onmousemove = DragHandler._drag; document.onmouseup = DragHandler._dragEnd; return false; }, // private method. Drag (move) element. _drag : function(e) { var oElem = DragHandler._oElem; var x = parseInt(oElem.style.left); var y = parseInt(oElem.style.top); e = e ? e : window.event; oElem.style.left = x + (e.clientX - oElem.mouseX) + 'px'; oElem.style.top = y + (e.clientY - oElem.mouseY) + 'px'; oElem.mouseX = e.clientX; oElem.mouseY = e.clientY; oElem.drag(oElem, x, y); return false; }, // private method. Stop drag process. _dragEnd : function() { var oElem = DragHandler._oElem; var x = parseInt(oElem.style.left); var y = parseInt(oElem.style.top); oElem.dragEnd(oElem, x, y); document.onmousemove = null; document.onmouseup = null; DragHandler._oElem = null; } } please helpCustom software and games development in Ukraine. www.xitexsoftware.comPost a reply
Related discussion
-
need Regular Expression for strong password
by bussureddy82 (4 replies)
-
Compatibility Issue on Firefox to display on Cursor Location
by dinc3r (1 replies)
-
How can I execute server-side function using asp.net Ontextchanged orJavascript onchange?
by konikula (6 replies)
-
VB.NET: Hide and show table using radio buttons
by converter2009 (1 replies)
-
Very Urgent regarding deleting the images from a folder
by Nanosteps (6 replies)
Quick links
Recent activity
- nancy smith replied to How to convert mts to mov o...
- nancy smith replied to How to play MTS/M2TS with q...
- scofield sofia replied to Convert 3GP to video for Mac?
- chicken007 chicken007 replied to Share some useful tools for...
- mary g replied to visual basic project
- mary g replied to visual basic project
Languages
Web Development
Frameworks & Architecture
Other major sections
Enter your message below
Sign in or Join us (it's free).