开发者

How to customize HTML/CSS tooltips?

What's the best way to customize HTML/CSS tooltips? (I mean an easy, cross-browser solution.)

I need to reduce the fade-in delay and change the style. (Also, c开发者_开发技巧ould you suggest a good jQuery plug-in for it?)


I have used qTip and the older version, Simpletip before and they work pretty well in all browsers (even IE6!).

The documentation is really good and you can configure the fade in/out delay: http://craigsworks.com/projects/qtip/docs/reference/#show

Style reference: http://craigsworks.com/projects/qtip/docs/tutorials/#styling


Using jQuery, you could get the title attribute of an object and add an element with that value. There is a little gem from jQuery: Novice to Ninja (SitePoint 2010). I am unsure if I am allowed to post it here, although the the code itself has been made public on sitepoint by the authors. Download the archive and see chapter_05\17_simple_tooltips. It's 25 lines long and works great.


This is another tooltip plugin worth looking at, http://code.drewwilson.com/entry/tiptip-jquery-plugin

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜