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

DragDrop and Snapping back to original location

Expand Messages
  • Karim Shehadeh
    I m trying to implement a page that has several draggable elements. There are files that can be dragged onto folders. When the user drops the file onto the
    Message 1 of 3 , Feb 28, 2007
    • 0 Attachment
      I'm trying to implement a page that has several draggable elements.
      There are files that can be dragged onto folders. When the user drops
      the file onto the folder, something happens. But if the user releases
      when not over a valid target, I want the draggable item to remain in its
      original position. some of the examples behave this way but I can't
      figure out exactly what it is that's allowing that to happen. I'm use
      the DD and DDTarget for my work. Anyone have any ideas?

      For what it's worth, I'm converting over to YUI from Scriptaculous which
      had this as a setting which is why I guess I was expecting the same
      thing with YUI.

      Thanks!
    • Karim Shehadeh
      I m trying to implement a page that has several draggable elements. There are files that can be dragged onto folders. When the user drops the file onto the
      Message 2 of 3 , Feb 28, 2007
      • 0 Attachment
        I'm trying to implement a page that has several draggable elements.
        There are files that can be dragged onto folders. When the user drops
        the file onto the folder, something happens. But if the user releases
        when not over a valid target, I want the draggable item to remain in its
        original position. some of the examples behave this way but I can't
        figure out exactly what it is that's allowing that to happen. I'm use
        the DD and DDTarget for my work. Anyone have any ideas?

        For what it's worth, I'm converting over to YUI from Scriptaculous which
        had this as a setting which is why I guess I was expecting the same
        thing with YUI.

        Thanks!
      • Michael Winston
        You ll want to create the functionality yourself using one of the many built-in interesting moments: var d = new YAHOO.util.DragDrop( something );
        Message 3 of 3 , Feb 28, 2007
        • 0 Attachment
          You'll want to create the functionality yourself using one of the
          many built-in interesting moments:

          var d = new YAHOO.util.DragDrop('something');
          d.onInvalidDrop = function(e) {
          YAHOO.Dom.util.setStyle(this.element, 'left', '0px');
          YAHOO.Dom.util.setStyle(this.element, 'top', '0px');
          }

          I think that's right...

          Michael



          On Feb 28, 2007, at 7:43 PM, Karim Shehadeh wrote:

          > I'm trying to implement a page that has several draggable elements.
          > There are files that can be dragged onto folders. When the user drops
          > the file onto the folder, something happens. But if the user releases
          > when not over a valid target, I want the draggable item to remain
          > in its
          > original position. some of the examples behave this way but I can't
          > figure out exactly what it is that's allowing that to happen. I'm use
          > the DD and DDTarget for my work. Anyone have any ideas?
          >
          > For what it's worth, I'm converting over to YUI from Scriptaculous
          > which
          > had this as a setting which is why I guess I was expecting the same
          > thing with YUI.
          >
          > Thanks!
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.