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

Re: Drag & Drop: where did I drag it to?

Expand Messages
  • trylon_perisphere
    Awesome! Thanks! I see I can use var myStyle = YAHOO.util.Dom.getStyle( lab , height ); to get the height (or other values), and that answers all my questions
    Message 1 of 3 , Mar 29, 2007
    • 0 Attachment
      Awesome! Thanks!

      I see I can use

      var myStyle = YAHOO.util.Dom.getStyle("lab","height");

      to get the height (or other values),
      and that answers all my questions for now. :)

      Other stuff in dom.js will probably be of use too.
      Cool.

      Thanks again!
      --T_P

      --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...> wrote:
      >
      > tyrlon_perisphere,
      >
      > Try:
      >
      > var myXY = YAHOO.util.Dom.getXY("lab");
      >
      > That should give you an array with the absolute (page-based)
      > coordinates for your element.
      >
      > Regards,
      > Eric
      >
      >
      > ______________________________________________
      > Eric Miraglia
      > Yahoo! User Interface Library
      >
      >
      >
      > On Mar 29, 2007, at 12:09 PM, trylon_perisphere wrote:
      >
      > > I'm trying to use the Drag & Drop libraries to help automate the
      > > construction of a color-
      > > coded map. A proof-of-concept prototype is here:
      > > http://dev-web04.med.wayne.edu/mapdrag3.html
      > >
      > > As you can see, a user can drag the red rectangle around. This is
      > > basically a paired-down
      > > version of this coding example:
      > > http://developer.yahoo.com/yui/examples/dragdrop/resize.html?mode=dist
      > > with my own graphics thrown in.
      > >
      > > This works perfectly for allowing a user to place the rectangle
      > > wherever they want, BUT I
      > > need to know where the rectangle has been dragged to!
      > >
      > > I added a button on the bottom that calls a function where I try to
      > > display the "top"
      > > property of the "lab" object in an alert. I figure once I can get
      > > one property, the rest should
      > > be easy enough to figure out.
      > >
      > > My function looks like this
      > > function coordinates() {
      > > var myobject = document.getElementById("lab");
      > > var myproperty = myobject.getAttribute("top");
      > > alert(myproperty);
      > > }
      > >
      > > But that just returns "null"
      > >
      > > Any idea as to what I'm doing wrong?
      > >
      > > Thanks in advance!
      > >
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.