Hi Simon,

SVGSVGElement.getIntersectionList( rect, referenceElement ) or
 .getEnclosureList(rect, referenceElement) would theoretically do the 
job.

Unfortuanetly it is only implemented in Batik ;-( It takes a 
rectangle as input, but you can specify a very small rectangle.

You can also ping the viewer developers to implement this very useful 
method.

Here is a very simple example:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://
www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 1024 
768" onload="testGetIntersectionList()">
    <script type="text/ecmascript">
        <![CDATA[
             function testGetIntersectionList() {
                var svgroot = document.documentElement;
                var myRect = svgroot.createSVGRect();
                myRect.x = 460;
                myRect.y = 460;
                myRect.width = 1;
                myRect.height = 1;
                var intersectList = 
svgroot.getIntersectionList(myRect,null);
                for (var i=0;i<intersectList.length;i++) {
                        alert("id of intersected 
element="+intersectList.item(i).getAttributeNS(null,"id"));
                }
           }
        ]]>
    </script>
    <title>Demonstration of the method 
SVGSVGElement.getIntersectionList()</title>
    <rect id="redRectangle" x="400" y="400" width="200" height="200" 
fill="red" />
    <rect id="blueRectangle" x="450" y="450" width="200" height="200" 
fill="blue" />
   <rect id="yellowRectangle" x="50" y="50" width="100" height="100" 
fill="yellow" />
   <rect pointer-events="none" x="458" y="458" width="4" height="4" 
fill="green" />
</svg>

--- In [email protected], "simonshutter" <[EMAIL PROTECTED]> 
wrote:
>
> Hi folks,
> 
> Is there a way that I can use the event model to identify all 
elements 
> that overlap a specific point on a mouse down/move event?  Or, do 
I 
> have to use clientX/Y and then test each element in turn?
> 
> Thanks, Simon
>




-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to