Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-02-2004, 09:38 PM   PM User | #1
DefKev
New Coder

 
Join Date: Oct 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
DefKev is an unknown quantity at this point
DragAndDrop - onDrop: Change position

Somebody can tell me what do i have to add at the 'onDrop : function' in the below script to drop the button at the cursor position after the user released the button ?

Code:
var windowObserver =
{
	onDragStart : function (element, transferData)
	{
		var Button = document.getElementById('Button');

			transferData.data = new TransferData();
	    		transferData.data.addDataForFlavour('Button-ID', Button);
	},

	getSupportedFlavours : function ()
	{
		var flavours = new FlavourSet();
			flavours.appendFlavour('Button-ID');
				return flavours;
	},

	onDrop : function (){},
};
DefKev is offline   Reply With Quote
Old 11-03-2004, 12:34 AM   PM User | #2
canadianjameson
Senior Coder

 
Join Date: Jul 2003
Location: My pimped-out igloo in Canadia
Posts: 1,966
Thanks: 36
Thanked 0 Times in 0 Posts
canadianjameson is an unknown quantity at this point
would it not be onmouseup?
__________________
Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)
canadianjameson is offline   Reply With Quote
Old 11-03-2004, 01:22 AM   PM User | #3
DefKev
New Coder

 
Join Date: Oct 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
DefKev is an unknown quantity at this point
Quote:
Originally Posted by canadianjameson
would it not be onmouseup?
Should i have to clarify that this is more an xul related question, if 'Yes', i excuse this mistake

If i try to set the x/y via setAttribute at 'onDrop' i get an 'NS_ERROR_FAILURE' ala 'What to drop, no data' !?!
DefKev is offline   Reply With Quote
Old 11-03-2004, 01:49 AM   PM User | #4
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
Quote:
Originally Posted by DefKev
Should i have to clarify that this is more an xul related question, ....
It would stand to reason that it would be in your best interest to clarify whatever is necassary to aide whomever is willing to help you...
Willy Duitt is offline   Reply With Quote
Old 11-03-2004, 02:33 PM   PM User | #5
DefKev
New Coder

 
Join Date: Oct 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
DefKev is an unknown quantity at this point
Quote:
Originally Posted by Willy Duitt
It would stand to reason that it would be in your best interest to clarify whatever is necassary to aide whomever is willing to help you...
The situation was what i had a simple window/stack/whatever with an 'onDragGesture', 'onDrop' ...

inside this was a button which calls the below *.js whenever the user starts dragging the button (drag and motion), the problem was that i had no idea what to call after the user has released the button somewhere inside this area to drop the button at the chosen position ('onDrop').

I allready figured it out, so, hm ... thanks anyway
DefKev is offline   Reply With Quote
Old 11-03-2004, 03:19 PM   PM User | #6
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
Quote:
Originally Posted by DefKev
Quote:
Originally Posted by Willy Duitt
It would stand to reason that it would be in your best interest to clarify whatever is necassary to aide whomever is willing to help you...
The situation was what i had a simple window/stack/whatever with an 'onDragGesture', 'onDrop' ...

inside this was a button which calls the below *.js whenever the user starts dragging the button (drag and motion), the problem was that i had no idea what to call after the user has released the button somewhere inside this area to drop the button at the chosen position ('onDrop').

I allready figured it out, so, hm ... thanks anyway
No need to thank me, anyways or not....
What you quoted was the extent of what I was willing to contribute... I only thought I should point out that sarcasm does not inspire nor promote effective feed back.... Just remember, it is you seeking a solution... Not someone else seeking a problem to solve....

.....Willy
Willy Duitt is offline   Reply With Quote
Old 11-03-2004, 04:32 PM   PM User | #7
DefKev
New Coder

 
Join Date: Oct 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
DefKev is an unknown quantity at this point
Quote:
Originally Posted by Willy Duitt
No need to thank me, anyways or not....
What you quoted was the extent of what I was willing to contribute... I only thought I should point out that sarcasm does not inspire nor promote effective feed back.... Just remember, it is you seeking a solution... Not someone else seeking a problem to solve....

.....Willy
I can't see any sarcasm in my question, so why do you start b!tching me ?

I have asked a DOM related question, and i expected a answer on my question not someone replying to it like 'im a retard' (this is not the reason why i visit a forum) !

If you don't want or can answer a question in a constructionally way, stop wasting other peoples time, it's not my debt if you misunderstand thinks.

'Thanks anyway' : a politeness phrase for taking your time and replying to my question, nothing more - nothing less.
DefKev is offline   Reply With Quote
Old 11-03-2004, 05:42 PM   PM User | #8
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
Where I'm sitting...

hm... thanks anyway is no more polite than Should i have to clarify that this is more an xul related question, if 'Yes', i excuse this mistake...

Both come off as sarcastic... And if you can not see that my posts were politely trying to show that your posts came off as sarcastic... Perhaps its you whom are wasting your own time... Without comprehension, you will only continue to flounder and repeat the same mistakes of the past...

Have a nice day;
.....Willy
Willy Duitt is offline   Reply With Quote
Old 11-03-2004, 06:23 PM   PM User | #9
DefKev
New Coder

 
Join Date: Oct 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
DefKev is an unknown quantity at this point
Have a nice day too.
DefKev is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:26 AM.


Advertisement
Log in to turn off these ads.