I do have many (>100) SVG-<g>
-elements on my screen, and if the user hovers over one of them, inner img-elements included in this <g>
should become visible. If the user hovers out of the <g>
, they should turn invisible again.
I see there are two ways of doing this:
- Insert the
<img>
on every mouseenter and remove it on mouseleave. - Insert the elements on every
<g>
during the initial rendering, make them initially invisible and turn them visible on mouseenter.
Which one is the way to go? If it is #2, whats the CSS property to use? I found many, including
visibility : hidden;
and
display : none;