开发者

What's the easiest way to show a tooltip on my web pages?

开发者 https://www.devze.com 2023-01-05 09:48 出处:网络
I\'d like to modify some parts of my website to show popups when a user clicks on some <td> elements. I\'d like to keep the modification very simple, which is w开发者_运维百科hy I considered usi

I'd like to modify some parts of my website to show popups when a user clicks on some <td> elements. I'd like to keep the modification very simple, which is w开发者_运维百科hy I considered using a JavaScript framework. It does not really matter which, but I'd like to be able to include html in the tooltip's text. What's the easiest way to achieve this? Could you maybe give an example?


qTip, a jQuery plugin, works very well for creating tooltips. It also supports HTML markup inside the tips. To have the tooltip show when clicking the element, rather than on mouseover, you can use the 'show' option:

jQuery('.selector').qtip({show: 'click'});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号