admin管理员组文章数量:1406177
I was wondering is it possible to customize the tooltip that we get after setting the title attribute in an img tag? Now I get a standard rectangle with blue background with text on it and what I'd want to get is my own image (lets say something that looks like a cloud) with text on it. Is it possible with css or js?
I was wondering is it possible to customize the tooltip that we get after setting the title attribute in an img tag? Now I get a standard rectangle with blue background with text on it and what I'd want to get is my own image (lets say something that looks like a cloud) with text on it. Is it possible with css or js?
Share Improve this question asked Sep 9, 2010 at 13:04 Mateusz DymczykMateusz Dymczyk 15.2k10 gold badges62 silver badges94 bronze badges4 Answers
Reset to default 4You need javascript for that. try this here or here Or you can roll your own. But basically there is no way to do it directly in html (dont know about htm5/css3).
Create your own! You can simply create a hidden div in your HTML, then when someone hovers over the image, show your div instead.
If you would like to create a custom tooltip, I would remend this. It shows you, in detail, how to create your own tooltips in js, which are CSS driven and can be easily reused.
Additionally, if you are using a framework, things get even easier. For example there are numerous jQuery tooltip plugins. These allow you to make your tooltips appear on the mouseover of any element.
I'll remend Tooltipster. Really easy to use, can be used on any element that supports the title
attribute and has many cool features and looks.
本文标签: javascriptCustomize the ltimg titlegt tooltipStack Overflow
版权声明:本文标题:javascript - Customize the <img title> tooltip - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744336834a2601238.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论