Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
how to call a function when an objects is droped over a target objec   Message List  
Reply | Forward Message #34087 of 52114 |
Re: how to call a function when an objects is droped over a target object??

Thanks a lot Dav

I will post the final script for my app

Regards

--- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
>
> rodvela --
>
> Currently Target's do not fire events, you have to place all your
logic in the Drag instances event..
>
> Something like this:
>
> var tar1 = new YAHOO.util.DDTarget('tar1');
> var tar2 = new YAHOO.util.DDTarget('tar2');
>
> var dd = new YAHOO.util.DD('drag');
> dd.onDragDrop = function(e, id) {
> switch (id) {
> case 'tar1':
> myTar1Function();
> break;
> case 'tar2':
> myTar2Function();
> break;
> }
> };
>
> Does that make sense?
> Dav
>
>
> Dav Glass
> dav.glass@...
> blog.davglass.com
>
>
>
>
> + Windows: n. - The most successful computer virus, ever. +
> + A computer without a Microsoft operating system is like a dog
> without bricks tied to its head +
> + A Microsoft Certified Systems Engineer is to computing what a
> McDonalds Certified Food Specialist is to fine cuisine +
>
>
>
> ----- Original Message ----
> From: rodvela <rodvela@...>
> To: ydn-javascript@yahoogroups.com
> Sent: Tuesday, July 8, 2008 11:20:35 AM
> Subject: [ydn-javascript] how to call a function when an objects is
droped over a target object??
>
> Hi
>
> i am using the YAHOO.util.DDTarget to create several target elements..
>
> But i need then to fire a diferent function when an object is droped
> over them.
>
> So when an object is droped over target_1 i whant it to call a
> function, but if the same object is droped over target_2 i whant it to
> call a diferente function.
>
> I have seen that the onDragDrop works with elements, but it does not
> work with target elements...
>
> Can some one help me with this???
>
> Thanks a lot
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>





Tue Jul 8, 2008 11:10 pm

rodvela
Offline Offline
Send Email Send Email

Forward
Message #34087 of 52114 |
Expand Messages Author Sort by Date

Hi i am using the YAHOO.util.DDTarget to create several target elements.. But i need then to fire a diferent function when an object is droped over them. So...
rodvela
Offline Send Email
Jul 8, 2008
6:20 pm

rodvela -- Currently Target's do not fire events, you have to place all your logic in the Drag instances event.. Something like this: var tar1 = new...
Dav Glass
dav.glass
Offline Send Email
Jul 8, 2008
7:07 pm

Thanks a lot Dav I will post the final script for my app Regards ... logic in the Drag instances event.. ... droped over a target object??...
rodvela
Offline Send Email
Jul 8, 2008
11:10 pm

Dav every thing ok but one thing i don't now how to do.. In the code below i mark several elements as dragdrop objects... (the targets are not created here...
rodvela
Offline Send Email
Jul 9, 2008
1:49 am

rodvela -- Try this: var dd = new YAHOO.util.DD('one'); dd.startDrag = function() { startPos = YAHOO.util.Dom.getXY(this.getEL()); } That should do it.. Dav ...
Dav Glass
dav.glass
Offline Send Email
Jul 9, 2008
2:02 am

Ok perfect.. but where should i put it inside my code in order to get the starPos of each element??? I dont see it... Thanks Dav Sorry for the many...
rodvela
Offline Send Email
Jul 9, 2008
2:24 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help