JavaScript
  Home arrow JavaScript arrow Page 7 - How to Use the Dojo Tooltip Widget
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

How to Use the Dojo Tooltip Widget
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 12
    2007-01-23

    Table of Contents:
  • How to Use the Dojo Tooltip Widget
  • Tooltip in HTML
  • Creating a tooltip for objects
  • Getting some color into the tooltip
  • How about an image in the tooltip?
  • The default style of dojoType tooltip
  • Creating a tooltip dynamically

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    How to Use the Dojo Tooltip Widget - Creating a tooltip dynamically


    (Page 7 of 7 )

    You can declare an object variable, assign it to a dojo type tooltip, and then use that tooltip to be attached to an element as shown in the example. The <span/> element contains an animated gif image of an elephant as shown. Notice the syntax used in creating the widget by code. You specify the type of dojo widget, then within curly braces you specify the attributes, the most important of which is the id of the HTML tag to which you want to attach the tooltip. The code for this page is shown in the next paragraph. Notice that the alt attribute which is also added to the image tag runs together with the tooltip as shown in the displayed page.

    <html>
    <head>
    <title>Create a dojo tooltip</title>
    <script type="text/javascript">
    var djConfig = { isDebug: true };
    </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.Button"); dojo.require("dojo.widget.Tooltip"); dojo.addOnLoad(init); var ttip; function init(){ ttip=dojo.widget.createWidget
    ("tooltip", {connectId:"four", caption:"Elephas maximus"}); } </script> <body style="background-color:#efeffe;"><h3>Tooltip created by code</h3> <span id="four"> <img alt="Elephant" src="http://images.devshed.com/da/stories/
    ../DojoAjax/Elephant.gif"/> </span> </body> </html>

    The displayed output on IE 7.0 with tooltip showing is as follows. Notice the alt showing on the same image.

     

    Summary

    One should seriously consider using Dojo for rich Internet client scripting. While the API is huge, the documentation is sparse. With more detailed documentation and clear examples of usage, dojo toolkit can play a dominant role in rich client applications and will find widespread use. This tutorial just described an extremely small item in an extremely large package. Most of the tests were verified with the three browsers IE 7.0, FireFox2.0 and Opera 9.01. All of the examples worked with the three browsers with some very minor display differences, except that the sliding show did not bring up the images in FireFox 2.0.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · That is correct. No more drab looking tooltip. You can put anything you want,...
       · Thanx for writing this, I really needed an explanation of how to use it. But...
     

    JAVASCRIPT ARTICLES

    - More on JavaScript Array Objects
    - Methods of the DOM Location Object
    - The DOM Location Object Properties
    - Handling Remote Files with JavaScript Click ...
    - Using Click Interceptions with a Database-Dr...
    - Using JavaScript Click Interceptions in an I...
    - Using Click Interceptions with JavaScript
    - QuickSort in Action
    - Quicksort
    - Using Mod_Security to Protect Your Server
    - Detecting and Countering Server Intrusions
    - Securing Your Web Server
    - Building a Secure Web Server
    - Protecting the Server
    - Book Review: Learning the Yahoo! User Interf...


     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT