css - Show hidden rect with text on hover of another poly -
i need use pure svg project. know how effect divs dont know how make work svg, dont know im doing wrong.
i want show hidden black rect white text when hover on polygon (and polygon 0.1 of opacity normal , changes 0.8 of opacity on same hover) tooltip opacity , nice smooth transition, pure svg.
.showme { opacity: 0.3; } .showme:hover { opacity: 0.8; } .desc { visibility: hidden; } .showme:hover + .desc { visibility: visible; }
<svg width="200" height="200" viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1" > <rect x="1" y="1" width="998" height="298" fill="blue" class="showme"/> </svg> <svg width="200" height="200" viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1" class="desc" > <rect x="1" y="1" width="998" height="298" fill="black" /> <text x="250" y="150" font-family="verdana" font-size="55" fill="white">hello world!</text> </svg>
please :/
thanks.
keeping svg, can this, you'll need slight changes:
<svg width="200" height="200" viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1" > <rect onmouseover='document.getelementbyid("desc").style.visibility = "visible"' onmouseout='document.getelementbyid("desc").style.visibility = "hidden"' x="1" y="1" width="998" height="298" fill="blue" class="showme"/> </svg> <svg width="200" height="200" viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" version="1.1" id="desc" > <rect x="1" y="1" width="998" height="298" fill="black" /> <text x="250" y="150" font-family="verdana" font-size="55" fill="white">hello world!</text> </svg>
Comments
Post a Comment