简体   繁体   中英

SVG hover not working in IE9 or Chrome

I have a basic SVG that displays the title when you hover over the object. It works fine in FF 38 but not at all in IE9 or Chrome.

Are there specific requirements for Chrome and IE that I'm missing?

Fiddle

In SVG tooltips are implemented as child title elements and not as title attributes as they are in html. So you need to create something that looks like this...

<path d="whatever">
    <title>Yellow 999</title>
</path>

What you're seeing is a bug in Firefox that I fixed recently . Firefox 46 onwards will work the same as Chrome and IE and not show a title attribute as a tooltip.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM