Using the jQuery Tooltip Plug-in`s bodyHandler Argument
(Page 1 of 4 )
In this fifth installment of a seven-part series on the jQuery Tooltip plug-in, I discuss the use of the “bodyHandler” argument. It can be really useful for injecting HTML code into tooltips, thus altering their default visual appearance and behavior.
Introduction
Among the numerous plug-ins available nowadays for the jQuery library, there's one that might be particularly appealing to many web designers because of its flat learning curve and extremely simple configuration. Naturally, I'm talking about the "Tooltip" plug-in. It's a small, handy application that permits you to display professional-looking pop-up notes next to targeted web page links by using only a single JavaScript method called "tooltip()," which must be invoked with the proper incoming parameters.
So, if you're curious about how to incorporate this helpful plug-in into your own web site to enhance its functionality, then in this group of articles you'll find a comprehensive guide that will show you how to work with tooltips in a truly effortless fashion.
And now that you know what to expect from this series of tutorials, it'd be useful summarize the topics that were discussed in the last article. In that part of the series, I used a couple of hands-on examples to help explain how to use the "top" and "left" arguments of the Tooltip plug-in to modify the respective default coordinates where they're displayed on screen.
Utilizing these parameters in a concrete case is a process very similar to assigning "left" and "top" CSS properties to elements of a web page, meaning that you shouldn't have major problems understanding how they work in a real-world example. However, as I said in previous articles, the Tooltip plug-in comes equipped with other arguments that can help to customize the visual appearance and behavior of tooltips even further.
So, in this fifth chapter of this series, I'm going to discuss the usage of the "bodyHandler" parameter. It can be used for injecting HTML code directly into the tooltips in question. First, I'll be developing some basic examples that will demonstrate how to implement this new argument, and then, once you've grasped its logic, I'll proceed to create more useful code samples.
Now, it's time to leave the preliminaries behind and start learning how to use the handy "bodyHandler" argument. Let's jump in!
Next: Review: the top and left parameters >>
More JavaScript Articles
More By Alejandro Gervasio