I have a click event bound to a div element, inside this div I am embedding an SVG file using an iframe (I have tried with object/embed elements an the result is the same) like so:
<div id="example">
<iframe src="example.svg" type="image/svg+xml" width="100%" height="100%"></iframe>
</div>
When I add the iframe element, it’s parents click event no longer fires.
If I embed the SVG in an IMG element all is fine but the svg scaling no longer works correctly.
Is there an elegant workaround for this?
Thanks in advance.
you can try to mask the iframe
the problem with this solution is that the context menu isn’t relative to the image anymore.