Go to your blog admin area, head to the "Write" page, move your mouse over the "Add media" tiny icons: you probably had noticed it already, WordPress 2.5 comes with a neat tooltip function. Using it in your own plugins is so easy that a hamster could do it.
First, in the HTML output of your plugin page, add a new classname — say "givemesometips" — to some elements, and give them a meaningful title.
-
<p>The question mark hides a tooltip! <span class="givemesometips" title="Hello, I am a tip">?</span></p>
-
<p>This image too! <img src="someimage.gif" alt="some image" title="I am a tip, too!" class="givemesometips" /></p>
Now, somewhere in your plugin page, add this Javascript call:
-
<script type="text/javascript">
-
jQuery(document).ready( function() {
-
jQuery('.givemesometips').tTips(); // tooltipize elements with classname "givemesometips"
-
});
-
</script>
And that's it. If your hamster cannot do this, consider upgrading it! For your convenience, here is a sample dummy plugin with tooltip examples in the page it creates under the Setting menu. Have fun!
Related posts
Shorter URL
Want to share or tweet this post? Please use this short URL: http://ozh.in/hn
Pages: [4] 3 2 1 » Show All
wrote, on 24/Apr/10 at 11:34 am # :
its seems like already gone in wp 2.9 :(
pingback on 15/Apr/09 at 3:35 pm # :
[...] Full Article [...]
pingback on 17/May/08 at 12:57 am # :
[...] WP 2.5 tooltips [...]
replied, on 24/Apr/08 at 6:35 pm # :
i usllay use a plugin called ... WordPress Automatic Update to do my updates ...
but this time i upgraded manually ...
all went well for the most part ...
some links broke ... but were easy to fix ...
if anyone of you know how to get lightbox to work on 2.5 ...
plz do drop me a line on my blog ...
thanks ...