Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropdown Menu over SVG?

I have an svg canvas full of interesting data visualizations using d3 and I'd like to have a traditional html dropdown menu appear above an svg:rect element. Is this possible? I realize I could use foreignObject, but that's incompatible with IE.

like image 867
Elijah Avatar asked Aug 18 '12 04:08

Elijah


1 Answers

It works fine as long as you arrange the elements correctly. In the example here, I've used an absolute positioned DIV on top of the SVG element (move your mouse around the output window to see the DIV move around). (The code uses Raphael rather than D3, but the results will be the same).

like image 130
WiredPrairie Avatar answered Oct 18 '22 13:10

WiredPrairie