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

Re: HELP!! click on child elements and return id? Please Help!!

Expand Messages
  • lemuelSquelch
    Thanks dude I got it working now!! I owe you one ... returns ... the id ... sense). ... r= 5 ... unsubscribe@yahoogroups.com ... click edit my membership
    Message 1 of 4 , Jan 30, 2004
    • 0 Attachment
      Thanks dude I got it working now!!
      I owe you one


      --- In svg-developers@yahoogroups.com, Thomas DeWeese
      <thomas.deweese@k...> wrote:
      > lemuelSquelch wrote:
      >
      > > Hi I have got my jSvgcanvas so that when I click on it, it
      returns
      > > the id of the first element. What I need is for it to return
      the id
      > > of the child element that is clicked on (hope this makes
      sense).
      > > here is my svg code for that bit ...
      >
      > I already showed you how to attach a listener to the element's
      > and get called back when the click happens. If you didn't know it
      > 'evt.getTarget()' returns the actual element clicked on. So you
      > can get it's 'id' attribute.
      >
      > >
      > > <g id="dynamic"><circle r="5" id="1" cx="20" cy="20"/><circle
      r="5"
      > > id="2" cx="50" cy="80"/></g></svg>
      > >
      > > By using the java commands
      > >
      > > Element test = (Element)(elt.getFirstChild());
      > > String test1 = test.toString();
      > > String svgid = test.getAttribute("id");
      > >
      > > I can return the id "1" but if i click on circle with id "2" it
      > > still returns id "1".
      > >
      > > Since these circles are both child elements of the "dynamic"
      > > element, is there a way of me getting the id's back?
      > >
      > > Thanks
      > >
      > >
      > > -----
      > > To unsubscribe send a message to: svg-developers-
      unsubscribe@yahoogroups.com
      > > -or-
      > > visit http://groups.yahoo.com/group/svg-developers and
      click "edit my membership"
      > > ----
      > >
      > > Yahoo! Groups Links
      > >
      > > To visit your group on the web, go to:
      > > http://groups.yahoo.com/group/svg-developers/
      > >
      > > To unsubscribe from this group, send an email to:
      > > svg-developers-unsubscribe@yahoogroups.com
      > >
      > > Your use of Yahoo! Groups is subject to:
      > > http://docs.yahoo.com/info/terms/
      > >
      > >
    Your message has been successfully submitted and would be delivered to recipients shortly.