Home arrow JavaScript arrow Page 3 - How to Use the Dojo Tooltip Widget
JAVASCRIPT

How to Use the Dojo Tooltip Widget


Windows uses tooltips; they're also commonly found on web pages. This article shows you how to use dojo to render tooltips with some very useful and unusual effects.

Author Info:
By: Jayaram Krishnaswamy
Rating: 3 stars3 stars3 stars3 stars3 stars / 16
January 23, 2007
TABLE OF CONTENTS:
  1. · How to Use the Dojo Tooltip Widget
  2. · Tooltip in HTML
  3. · Creating a tooltip for objects
  4. · Getting some color into the tooltip
  5. · How about an image in the tooltip?
  6. · The default style of dojoType tooltip
  7. · Creating a tooltip dynamically

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
How to Use the Dojo Tooltip Widget - Creating a tooltip for objects
(Page 3 of 7 )

Using tag attributes

You can easily create a tooltip using tags as shown in the following code for a button:

<HTML> 
<HEAD> 
<TITLE> </TITLE> 
<script type="text/javascript">
var djConfig = {isDebug: true, debugAtAllCosts: false };
</script>
<script type="text/javascript" 
src="http://images.devshed.com/da/stories/
http://localhost/DoAjax/dojo.js"> </script> <script type="text/javascript"> dojo.require("dojo.widget.Tooltip"); </script> </HEAD> <BODY> <!--Button--> <!--This places a button--> <button id="myButton">DoJo Button</button> <!--This adds a tooltip control--> <!--The connectId property adds this control referencing the "myButton" id--> <!--The caption is what gets displayed in the pop-up window of the tooltip--> <span dojoType="tooltip" connectId="myButton" caption="tooltip on button"> </span> <!--end button--> </BODY> </HTML>

The rendered button shows the tooltip as in the next picture from IE 7.0. It is practically the same in FireFix2.0 and Opera 9.0. As you can see, it is a true cross browser functionality.

In the following sections some of the code in the previous listing will not be repeated and the reader may cut and paste the code fragments between the <!--Button  -->   ....paste code here... <!--end button --> lines appropriately.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials