divs onclick
div show up on button click
HTML
<svg id="canvas" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect id="pointer" x=10 y="20" width="10" height="10"
style="fill:blue;stroke:pink;stroke-width:5;opacity:0.5"/>
<circle
id="c1" class="multic" fill="#DD9" stroke="#AAA"
r="50" cx="70" cy="150" />
<circle
id="c2" class="multic" fill="#9DD" stroke="#AAA"
r="50" cx="120" cy="150" />
</svg>
JavaScript
function s$(a) {
return document.getElementById(a);
}
var list
function hoverElement(evt) {
var root = s$("canvas");
var disp = s$("pointer");
disp.setAttribute("x",evt.clientX);
disp.setAttribute("y",evt.clientY);
rpos = root.createSVGRect();
rpos.x = evt.clientX;
rpos.y = evt.clientY;
rpos.width = rpos.height = 1;
list = root.getIntersectionList(rpos, null);
s = "clicked: "
$.each(list,function(item,val){
if (val.id != "pointer") {
s = s + (val.id) + " ";
}
})
alert(s);
}
var root = s$("canvas");
root.addEventListener("click", hoverElement, false);