Click here to Skip to main content
15,909,939 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: problem in creating two submit buttons in same form Pin
JUNEYT18-Sep-06 10:34
JUNEYT18-Sep-06 10:34 
Questiondatagrid onItemCommand to call a javascript function Pin
Ghassan ka14-Sep-06 2:54
Ghassan ka14-Sep-06 2:54 
AnswerRe: datagrid onItemCommand to call a javascript function Pin
_AK_14-Sep-06 11:17
_AK_14-Sep-06 11:17 
GeneralRe: datagrid onItemCommand to call a javascript function Pin
Ghassan ka16-Sep-06 21:28
Ghassan ka16-Sep-06 21:28 
QuestionInterface suggestions Pin
Malcolm Smart14-Sep-06 0:39
Malcolm Smart14-Sep-06 0:39 
AnswerRe: Interface suggestions Pin
RichardGrimmer14-Sep-06 2:46
RichardGrimmer14-Sep-06 2:46 
GeneralRe: Interface suggestions Pin
Malcolm Smart14-Sep-06 3:01
Malcolm Smart14-Sep-06 3:01 
GeneralRe: Interface suggestions Pin
RichardGrimmer15-Sep-06 3:14
RichardGrimmer15-Sep-06 3:14 
Malcolm Smart wrote:
plz give me the codes man that let me do this.


LMGDAO!

OK - it's actually pretty simple. First thing to do is add your div at the correct place on the page. You should be able to work this out ok from your existing stuff, so all you need to do is add a div with position:absolute and top / left style attributes.

Once you have the div on the screen, you need to know if the user holds down the button on it, to start the drag operation. To do this, just add an "onmousedown" attribute which points at a function which just updates a variable to say "we're dragging now", and an onmouseup attribute which does the opposite.

OK - now we need to know when the user is dragging - to do this, we add an onmousemove handler to an appropriate object - ususally the document, but can restrict it to a "canvas" object (like a containing div) which will improve performance - the event is continually fired when moving the mouse, ,so makes sense to try to restrict it a little.

OK, the handler that we need just needs to check if we're holding down the button - which is where the mouse up / down bit comes in. If we're not dragging, then we simply return from the handler without doing anything, but if we ARE holding down the button we need to work out what to do next....

First thing is to get the current size and position of the div. We can get these from the various style attributes. Once we know how big it is currently, we work out where the mouse pointer is from event.clientX / event.clientY. From this, we can work out how wide (or tall) the div needs to be to make it extend to the current mouse position, and update it's style.width attribute.

If you need any more help, send me an email, and will see what I can do


"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox

GeneralRe: Interface suggestions Pin
Malcolm Smart17-Sep-06 20:37
Malcolm Smart17-Sep-06 20:37 
GeneralRe: Interface suggestions Pin
RichardGrimmer19-Sep-06 7:34
RichardGrimmer19-Sep-06 7:34 
AnswerRe: Interface suggestions Pin
Boro_Bob14-Sep-06 23:46
Boro_Bob14-Sep-06 23:46 
Questionhow to keep web service and c++ client connection??, Pin
AndyLau00413-Sep-06 21:56
AndyLau00413-Sep-06 21:56 
Questionpreserving object reference in a page Pin
248912813-Sep-06 20:44
248912813-Sep-06 20:44 
AnswerRe: preserving object reference in a page Pin
RichardGrimmer14-Sep-06 2:47
RichardGrimmer14-Sep-06 2:47 
GeneralRe: preserving object reference in a page Pin
Guffa14-Sep-06 7:51
Guffa14-Sep-06 7:51 
GeneralRe: preserving object reference in a page Pin
RichardGrimmer19-Sep-06 7:33
RichardGrimmer19-Sep-06 7:33 
AnswerRe: preserving object reference in a page Pin
Guffa19-Sep-06 20:58
Guffa19-Sep-06 20:58 
AnswerRe: preserving object reference in a page Pin
Guffa14-Sep-06 7:48
Guffa14-Sep-06 7:48 
QuestionProblems downloading objects in IE7 Pin
OrcBighter213-Sep-06 18:25
OrcBighter213-Sep-06 18:25 
Questionproblem with menu control Pin
bankerkev13-Sep-06 14:55
bankerkev13-Sep-06 14:55 
AnswerRe: problem with menu control Pin
_AK_14-Sep-06 11:18
_AK_14-Sep-06 11:18 
QuestionIs there recursion in JavaScript [modified] Pin
10011000100101101000013-Sep-06 8:14
10011000100101101000013-Sep-06 8:14 
AnswerRe: Is there recursion in JavaScript Pin
Guffa14-Sep-06 7:58
Guffa14-Sep-06 7:58 
QuestionI need an advice from an expert about server side includes Pin
JUNEYT13-Sep-06 6:15
JUNEYT13-Sep-06 6:15 
AnswerRe: I need an advice from an expert about server side includes Pin
Guffa14-Sep-06 7:59
Guffa14-Sep-06 7:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.