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

event.getTarget

Expand Messages
  • dr. stefan goessner
    hi, .. i ran into a problem selecting an element by mouse. i use adobe s svg-control 1.0. at the first look, doing this works fine: just implement the
    Message 1 of 3 , Jun 22, 2000
    • 0 Attachment
      hi,

      .. i ran into a problem selecting an element by mouse. i use adobe's
      svg-control 1.0. at the first look, doing this works fine: just
      implement the 'onmousedown' handler and invoke it's 'event'
      argument's 'getTarget()' method ..

      function OnMouseDownEvent(event)
      {
      window.alert(event.getTarget().tagName); // .. type of element ?
      }

      .. since i am dragging an element when trying to click-select another
      element, event.getTarget() always returns - obvious correctly - the
      dragged element. so i currently see no way to get the other dom
      element.

      .. i had a quick look at adobe's release note's and the DOM2 events,
      but that doesn't help a lot.

      1) is there a solution to the problem (event bubbling does not work,
      since the element are sibblings), i.e. did i overlooked something?
      2) some cad-systems define a square region about the pick point and
      return a list of all elements inside that region. so it seems to be
      an improvement to let 'getTarget()' return a list of elements instead
      of a single one.

      thanks for listening ..

      stefan goessner
    • johncoe42
      The selection set extension that you suggest, would be very usefull. SVG s clip to viewport may be one way to produce the selection set list! Here is the link
      Message 2 of 3 , Jan 19, 2004
      • 0 Attachment
        The selection set extension that you suggest, would be very usefull.
        SVG's clip to viewport may be one way to produce the selection set
        list! Here is the link to it's doc.
        http://www.w3.org/TR/SVG11/masking.html#OverflowAndClipProperties

        I think the overflow property could be used to remove elements from a
        list of objects to consider.


        --- In svg-developers@yahoogroups.com, "dr. stefan goessner"
        <stefan.goessner@h...> wrote:
        > hi,
        >
        > .. i ran into a problem selecting an element by mouse. i use
        adobe's
        > svg-control 1.0. at the first look, doing this works fine: just
        > implement the 'onmousedown' handler and invoke it's 'event'
        > argument's 'getTarget()' method ..
        >
        > function OnMouseDownEvent(event)
        > {
        > window.alert(event.getTarget().tagName); // .. type of element ?
        > }
        >
        > .. since i am dragging an element when trying to click-select
        another
        > element, event.getTarget() always returns - obvious correctly - the
        > dragged element. so i currently see no way to get the other dom
        > element.
        >
        > .. i had a quick look at adobe's release note's and the DOM2
        events,
        > but that doesn't help a lot.
        >
        > 1) is there a solution to the problem (event bubbling does not
        work,
        > since the element are sibblings), i.e. did i overlooked something?
        > 2) some cad-systems define a square region about the pick point and
        > return a list of all elements inside that region. so it seems to be
        > an improvement to let 'getTarget()' return a list of elements
        instead
        > of a single one.
        >
        > thanks for listening ..
        >
        > stefan goessner
      • Thomas DeWeese
        Hi Stefan, John, I actually think the suggested methods exist in SVG 1.0 it is just that no UA to date has implemented them. Take a look at the DOM interface
        Message 3 of 3 , Jan 19, 2004
        • 0 Attachment
          Hi Stefan, John,

          I actually think the suggested methods exist in SVG 1.0
          it is just that no UA to date has implemented them. Take
          a look at the DOM interface for the SVGElement.

          That said I think all you need to do is set pointer-events
          to 'none' in the mouse-down handler so that you can get the
          object you are dragging over as the target (then remember
          to restore pointer-events in the mouse-up).


          johncoe42 wrote:
          > The selection set extension that you suggest, would be very usefull.
          > SVG's clip to viewport may be one way to produce the selection set
          > list! Here is the link to it's doc.
          > http://www.w3.org/TR/SVG11/masking.html#OverflowAndClipProperties
          >
          > I think the overflow property could be used to remove elements from a
          > list of objects to consider.
          >
          >
          > --- In svg-developers@yahoogroups.com, "dr. stefan goessner"
          > <stefan.goessner@h...> wrote:
          >
          >>hi,
          >>
          >>.. i ran into a problem selecting an element by mouse. i use
          >
          > adobe's
          >
          >>svg-control 1.0. at the first look, doing this works fine: just
          >>implement the 'onmousedown' handler and invoke it's 'event'
          >>argument's 'getTarget()' method ..
          >>
          >>function OnMouseDownEvent(event)
          >>{
          >> window.alert(event.getTarget().tagName); // .. type of element ?
          >>}
          >>
          >>.. since i am dragging an element when trying to click-select
          >
          > another
          >
          >>element, event.getTarget() always returns - obvious correctly - the
          >>dragged element. so i currently see no way to get the other dom
          >>element.
          >>
          >>.. i had a quick look at adobe's release note's and the DOM2
          >
          > events,
          >
          >>but that doesn't help a lot.
          >>
          >>1) is there a solution to the problem (event bubbling does not
          >
          > work,
          >
          >>since the element are sibblings), i.e. did i overlooked something?
          >>2) some cad-systems define a square region about the pick point and
          >>return a list of all elements inside that region. so it seems to be
          >>an improvement to let 'getTarget()' return a list of elements
          >
          > instead
          >
          >>of a single one.
          >>
          >>thanks for listening ..
          >>
          >>stefan goessner
          >
          >
          >
          > -----
          > 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.