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

Drag, Drop and Resize an Image

Expand Messages
  • betto84
    Hi! I m using var resize = new YAHOO.util.Resize( img , { handles: all , knobHandles: true, height: 100px , width: 100px , draggable: true, }); to create a
    Message 1 of 6 , Dec 29, 2008
    • 0 Attachment
      Hi!

      I'm using

      var resize = new YAHOO.util.Resize('img', {
      handles: 'all',
      knobHandles: true,
      height: '100px',
      width: '100px',
      draggable: true,
      });

      to create a draggable and resizable image. But now it's only possible
      to access the "dragEvent", what I need is the "endDrag"-Event. How do
      I accomplish this?

      Sorry for this question, it's my first day with YUI.
    • Dav Glass
      betto84 -- The DD instance that Resize uses is attached at .dd, so you can access it like this: resize.dd.on( endDragEvent , function() { }); Does that help?
      Message 2 of 6 , Dec 29, 2008
      • 0 Attachment
        betto84 --

        The DD instance that Resize uses is attached at .dd, so you can access it like this:

        resize.dd.on('endDragEvent', function() {
        });

        Does that help?
        Dav

        --
        Dav Glass
        davglass@...
        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  +


        On Mon, Dec 29, 2008 at 4:15 AM, betto84 <betto84@...> wrote:

        Hi!

        I'm using

        var resize = new YAHOO.util.Resize('img', {
        handles: 'all',
        knobHandles: true,
        height: '100px',
        width: '100px',
        draggable: true,
        });

        to create a draggable and resizable image. But now it's only possible
        to access the "dragEvent", what I need is the "endDrag"-Event. How do
        I accomplish this?

        Sorry for this question, it's my first day with YUI.


      • betto84
        ... access it ... Pefect! Thank you very much!
        Message 3 of 6 , Dec 30, 2008
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "Dav Glass" <davglass@...>
          > The DD instance that Resize uses is attached at .dd, so you can
          access it
          > like this:
          >
          > resize.dd.on('endDragEvent', function() {
          > });
          >
          > Does that help?

          Pefect! Thank you very much!
        • betto84
          ... I just tried this with the dragDropEvent and the invalidDropEvent. And these events don t get fired. Of course I specified a taret before. I also tried it
          Message 4 of 6 , Dec 30, 2008
          • 0 Attachment
            > --- In ydn-javascript@yahoogroups.com, "Dav Glass" <davglass@>
            > > resize.dd.on('endDragEvent', function() {
            > > });

            I just tried this with the dragDropEvent and the invalidDropEvent.
            And these events don't get fired. Of course I specified a taret
            before. I also tried it with an YAHOO.util.DD and it works. Is there
            a way to get this working with Resize as well?
          • Dav Glass
            betto84 -- Resize configures DragDrop with the dragOnly config option: http://developer.yahoo.com/yui/docs/YAHOO.util.DragDrop.html#property_dragOnly You can
            Message 5 of 6 , Dec 30, 2008
            • 0 Attachment
              betto84 --

              Resize configures DragDrop with the dragOnly config option:
              http://developer.yahoo.com/yui/docs/YAHOO.util.DragDrop.html#property_dragOnly

              You can reset that like this:

              var resize = new YAHOO.util.Resize(//);
              resize.dd.dragOnly = false;
              resize.dd.on('dragDropEvent', function() {});

              Does that help?
              Dav

              --
              Dav Glass
              davglass@...
              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  +


              On Tue, Dec 30, 2008 at 7:40 PM, betto84 <betto84@...> wrote:

              > --- In ydn-javascript@yahoogroups.com, "Dav Glass" <davglass@>
              > > resize.dd.on('endDragEvent', function() {
              > > });

              I just tried this with the dragDropEvent and the invalidDropEvent.
              And these events don't get fired. Of course I specified a taret
              before. I also tried it with an YAHOO.util.DD and it works. Is there
              a way to get this working with Resize as well?


            • betto84
              ... Of course, thank you! Can you tell me where to find such information? I looked through the API but couldn t find anything about the dd of
              Message 6 of 6 , Jan 1, 2009
              • 0 Attachment
                --- In ydn-javascript@yahoogroups.com, "Dav Glass" <davglass@...>
                wrote:
                > var resize = new YAHOO.util.Resize(//);
                > resize.dd.dragOnly = false;
                > resize.dd.on('dragDropEvent', function() {});
                >
                > Does that help?

                Of course, thank you! Can you tell me where to find such information?
                I looked through the API but couldn't find anything about the dd of
                YAHOO.util.Resize.


                And my problems continue: I want to programmatically move my object.
                Using YAHOO.util.Dom.setXY or YAHOO.util.Motion works for
                repositioning the image, but not the used knobHandles. How can I
                reposition or move the whole object and not only the image?
              Your message has been successfully submitted and would be delivered to recipients shortly.