Re: Pointer-events Suggestion

My only solution is a hack :(

Basically an invisible rect over the whole UI that receives all mouse
events.  Then use SVGSVGElement.getIntersectionList() on a tiny rect
centered on the mouse event.  This is a horrible hack, I know.

Unfortunately (fortunately?) getIntersectionList()/getEnclosureList()
are not implemented cross-browser, specifically Firefox.

Jeff

2009/11/5 Alex Danilo <alex@abbra.com>:
>
> Hi Ryan,
>
> --Original Message--:
>>>You should be able to attach an event handler on both rectangles and
>>
>>>both will receive the event.
>>
>>
>>
>>>That is standard DOM event bubbling behaviour.
>>
>>
>>
>>>If you're not getting events on both rectangles, then it's
>>
>>>likely the user agent you're using is buggy.
>>
>>
>>
>>>Cheers,
>>
>>>Alex
>>
>>
>>Thanks for the tip, Alex. This would certainly work in some cases but, unless I’m missing something, I believe it’s only when one rectangle is a DOM child/descendant of the other, right? My rectangles are DOM siblings, and sometimes not even siblings but nieces and nephews. As I understand it, the bubbling event only moves along the DOM via parent/child relationships on it’s way to it’s target. My other rectangle isn’t in the path of event travel so it never would never receive the event.
>
> Yes, good point. Capture/bubbling does require the ancestry relationships to work.
>
> That's certainly an interesting use-case you have. Maybe other  people will have
> some useful suggestions.
>
> Cheers,
> Alex
>
>>Ryan
>>
>>
>>
>>
>
>
>

Received on Friday, 6 November 2009 03:45:36 UTC