Loading ...
Sorry, an error occurred while loading the content.

Drag point on element - not on mouse

Expand Messages
  • traelnes
    Hello friends, I want to drag an object and then dock the object into a target. But default an event happens when the mouse pointer enters the target. I would
    Message 1 of 4 , Sep 6 1:20 PM
    • 0 Attachment
      Hello friends,

      I want to drag an object and then dock the object into a target. But
      default an event happens when the mouse pointer enters the target. I
      would like the event (of coming into target) to happen when the top
      left corner of my draggin element enters the target. Does anyone know
      how this can be done?

      Thanks
    • Adam Moore
      ... I think you are looking for intersect mode: http://developer.yahoo.com/yui/dragdrop/#intersect -Adam
      Message 2 of 4 , Sep 6 2:15 PM
      • 0 Attachment
        On Wed, Sep 06, 2006 at 08:20:16PM -0000, traelnes wrote:
        > Hello friends,
        >
        > I want to drag an object and then dock the object into a target. But
        > default an event happens when the mouse pointer enters the target. I
        > would like the event (of coming into target) to happen when the top
        > left corner of my draggin element enters the target. Does anyone know
        > how this can be done?

        I think you are looking for intersect mode:

        http://developer.yahoo.com/yui/dragdrop/#intersect

        -Adam
      • traelnes
        Thank! Of course... I have a follow-up question: If I dock the drag element using the onDragOver it kind of works. But even better would be to use
        Message 3 of 4 , Sep 6 2:50 PM
        • 0 Attachment
          Thank! Of course... I have a follow-up question: If I "dock" the drag
          element using the onDragOver it kind of works. But even better would
          be to use onDragEnter on the target. Problem is that using
          onDragEnter it will dock-onDragEnter then go back to the mouse-
          movement then when reaching next target dock-onDragEnter. So drag
          element flickers between the target and mouse-drag. I guess I must
          override some function here to disable it from going back to mouse-
          movement. Do you know which function handles this?

          --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...>
          wrote:
          >
          > On Wed, Sep 06, 2006 at 08:20:16PM -0000, traelnes wrote:
          > > Hello friends,
          > >
          > > I want to drag an object and then dock the object into a target.
          But
          > > default an event happens when the mouse pointer enters the
          target. I
          > > would like the event (of coming into target) to happen when the
          top
          > > left corner of my draggin element enters the target. Does anyone
          know
          > > how this can be done?
          >
          > I think you are looking for intersect mode:
          >
          > http://developer.yahoo.com/yui/dragdrop/#intersect
          >
          > -Adam
          >
        • Adam Moore
          ... This sounds like something worth adding a feature request for as there is not a straight-forward way to set up this docking behavior:
          Message 4 of 4 , Sep 6 4:17 PM
          • 0 Attachment
            On Wed, Sep 06, 2006 at 09:50:29PM -0000, traelnes wrote:
            > Thank! Of course... I have a follow-up question: If I "dock" the drag
            > element using the onDragOver it kind of works. But even better would
            > be to use onDragEnter on the target. Problem is that using
            > onDragEnter it will dock-onDragEnter then go back to the mouse-
            > movement then when reaching next target dock-onDragEnter. So drag
            > element flickers between the target and mouse-drag. I guess I must
            > override some function here to disable it from going back to mouse-
            > movement. Do you know which function handles this?

            This sounds like something worth adding a feature request for as there is
            not a straight-forward way to set up this docking behavior:

            http://sourceforge.net/tracker/?group_id=165715&atid=836476

            One possiblity: when you are about to dock the element you could clone the
            element, place the clone in the docked position, and hide the element you are
            dragging. Destroy the clone and make the drag element visible if the drag
            continues outside of the dock area or the drag ends (positioning it once if
            necessary).

            -Adam
          Your message has been successfully submitted and would be delivered to recipients shortly.