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

Ending object draggability

Expand Messages
  • henribagus
    I need make an object no longer draggable once it has been dropped onto the correct target. How is that done? Here s what I m doing: - An onmouseover event
    Message 1 of 4 , Jun 1, 2009
    • 0 Attachment
      I need make an object no longer draggable once it has been dropped onto the correct target. How is that done?


      Here's what I'm doing:

      - An onmouseover event makes the object draggable like this:

      dd = new YAHOO.util.DD(el);

      Note: drag object must be set dynamically because we don't know all IDs in advance, and the number of draggable objects can vary. It's for an educational game quiz.


      - onDragDrop waits for drag:

      dd.onDragDrop = function(e, id) {

      Checks dragged object is on the correct drop object.
      ...

      ** Here I need to make the object no longer draggable **

      }


      Many Thanks,

      Marcus
    • Dav Glass
      Try: dd.unreg(); -- Dav Glass davglass@gmail.com Sent from my iPhone
      Message 2 of 4 , Jun 2, 2009
      • 0 Attachment
        Try:

        dd.unreg();

        --
        Dav Glass
        Sent from my iPhone

        On Jun 1, 2009, at 4:37 PM, "henribagus" <prima@...> wrote:


        I need make an object no longer draggable once it has been dropped onto the correct target. How is that done?

        Here's what I'm doing:

        - An onmouseover event makes the object draggable like this:

        dd = new YAHOO.util.DD( el);

        Note: drag object must be set dynamically because we don't know all IDs in advance, and the number of draggable objects can vary. It's for an educational game quiz.

        - onDragDrop waits for drag:

        dd.onDragDrop = function(e, id) {

        Checks dragged object is on the correct drop object.
        ...

        ** Here I need to make the object no longer draggable **

        }

        Many Thanks,

        Marcus

      • henribagus
        ... That only works for the current drag event. If you mouseover another object then go back, the object becomes draggable again. Is it possible with subscribe
        Message 3 of 4 , Jun 2, 2009
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@...> wrote:
          >
          > Try:
          >
          > dd.unreg();


          That only works for the current drag event. If you mouseover another object then go back, the object becomes draggable again.

          Is it possible with subscribe and unsubscribe to the event, but only unsubscribing from a certain object?

          I need each object to be successfully dropped once only. One reason is that the user could cheat the scoring system by dragging a correct answer several times.

          Thanks,

          Marcus
        • Dav Glass
          Then you just need to track the items that you don t want to be dragged and not create the drag on mouseover. Dav ... -- Dav Glass davglass@gmail.com
          Message 4 of 4 , Jun 2, 2009
          • 0 Attachment
            Then you just need to track the items that you don't want to be dragged
            and not create the drag on mouseover.

            Dav

            On Tue, 02 Jun 2009, henribagus wrote:

            > --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@...> wrote:
            > >
            > > Try:
            > >
            > > dd.unreg();
            >
            >
            > That only works for the current drag event. If you mouseover another object then go back, the object becomes draggable again.
            >
            > Is it possible with subscribe and unsubscribe to the event, but only unsubscribing from a certain object?
            >
            > I need each object to be successfully dropped once only. One reason is that the user could cheat the scoring system by dragging a correct answer several times.
            >
            > Thanks,
            >
            > Marcus
            >
            >
            >

            --
            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 +
          Your message has been successfully submitted and would be delivered to recipients shortly.