JavaScript
  Home arrow JavaScript arrow Page 5 - 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 - How about an image in the tooltip?


    (Page 5 of 7 )

    It's really cool. You can pop up boxes showing images with some text if you need to with the following code. Here is a snippet to display images that can be used for associating pictures with text. Again between the <!--button-->....<--end button--> HTML section plug in the following code. The images are animated gif files and keep the reader interest high. Notice the attribute/value pair toggle="explode" which pops open explosively. The various picture files are using the URL reference.

    <!--Button-->
    <table width="25%" border="1">
    <tr><td>
    <ul>
    <li id="fish">Jelly Fish</li>
    <li id="mammal">Elephant  </li>
    <li id="bird">Bird </li>
    </ul>
    </td></tr></table>
    <span dojoType="tooltip" connectId="fish" toggle="explode"> 
    <img src="http://images.devshed.com/da/stories/
    http://localhost/DojoAjax/JellyFish.gif"></img><br/> Watch out could be poisonous
    </span> <span dojoType="tooltip" connectId="mammal" toggle="explode"> <img src="http://images.devshed.com/da/stories/
    http://localhost/DojoAjax/Elephant.gif"></img><br/> Largest Land Animal </span> <span dojoType="tooltip" connectId="bird" toggle="explode"> <img src="http://images.devshed.com/da/stories/
    http://localhost/DojoAjax/Bird.gif"></img><br/> Free in the skies </span> <!--end button-->

    Well the list element was confined within the borders of the table, otherwise the tooltip could pop up way beyond to a considerable extent as shown along the line in the next picture. Here is the display shown in Opera 9.0. Pay no heed to the messages from the Debug. These do not appear in the other browsers.

    A tooltip which fades out

    Here is a snippet for a button which will fade out. Just add the toggle attribute value (="fade") and the object fades as it gets rendered. The title attribute is added to bring out the differences between the tooltip that appears with the title attribute and the dojoTooltip. In fact both of the tooltips appear on the display as shown. The tooltip from the title is instantaneous while the one from dojo fades slowly, which can be controlled by changing the toggleDuration.

    <input type="button" id="btn" 
    title="This is a button" 
    value="eh!"/>
    <span dojoType="tooltip" 
    connectId="btn" 
    caption="This should fade!" toggle="fade" 
    toggleDuration="600"> </span>

    The next picture shows how it gets rendered.

    More JavaScript Articles
    More By Jayaram Krishnaswamy


       · 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 5 hosted by Hostway
    Stay green...Green IT