JavaScript
  Home arrow JavaScript arrow Page 4 - Applying a Fade Out Effect with the jQuery...
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 
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

Applying a Fade Out Effect with the jQuery Tooltip Plug-in
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-10-27

    Table of Contents:
  • Applying a Fade Out Effect with the jQuery Tooltip Plug-in
  • Review: creating mouse tracking tooltips
  • Applying a fade out effect to tooltips
  • Varying the duration of the fade out effect

  • 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


    Applying a Fade Out Effect with the jQuery Tooltip Plug-in - Varying the duration of the fade out effect


    (Page 4 of 4 )

    In the previous section, you learned how to apply a smooth fading out transition to tooltips on a web page, with a duration of 400 milliseconds. Based on this same schema, it’s also possible to assign a different value to the animation, to produce some interesting variations of the effect.

    The code sample below creates a 500 milliseconds fade out effect on a group of tooltips that, in this specific case, won’t track mouse movements. Here’s how this example looks:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    <title>Tooltip example using the fade parameter</title>

    <link rel="stylesheet" type="text/css" href="jquery.tooltip.css" />

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript" src="jquery.dimensions.js"></script>

    <script type="text/javascript" src="jquery.tooltip.js"></script>

    <script type="text/javascript">

    // assign tooltip to links after web page has been loaded

    // delay tooltip display 800 ms, track mouse position and fade it out

    $(document).ready(function(){

    $("a").tooltip({

    delay: 800,

    fade: 500

    });

    });

    </script>

    </head>

    <body>

    <ul>

    <li><a href="http://jquery.com" title="Sample Link 1">Sample Link 1</a></li>

    <li><a href="http://jquery.com" title="Sample Link 2">Sample Link 2</a></li>

    <li><a href="http://jquery.com" title="Sample Link 3">Sample Link 3</a></li>

    <li><a href="http://jquery.com" title="Sample Link 4">Sample Link 4</a></li>

    <li><a href="http://jquery.com" title="Sample Link 5">Sample Link 5</a></li>

    <li><a href="http://jquery.com" title="Sample Link 6">Sample Link 6</a></li>

    </ul>

    </body>

    </html>

    Here you have it. In this particular example I decided to assign a value of 500 milliseconds to the fade out transition, but as you might guess, this parameter can be configured to modify the duration of the effect. Feel free to edit all of the code samples developed in this tutorial, so you can practice applying a neat fade out effect to tooltips attached to a number of web page links.

    Final thoughts

    It’s hard to believe, but we’ve come to the end of this third part of the series. Overall the experience has been educational and why not, also fun, since you improved your skills in using the Tooltip jQuery plug-in. As you saw a few moments ago, customizing the appearance and behavior of tooltips is really a no-brainer process, even if you’re not familiar with the basics of the jQuery library.

    In the upcoming chapter, I’m going to discuss how to include HTML code within tootips, and how to modify their top and left coordinates respectively. Therefore, now that you’ve been warned about the topics that will be covered in the next tutorial, you won’t want to miss it!


    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.

       · This third chapter of the series explains how to apply a fade out animation effect...
     

    JAVASCRIPT ARTICLES

    - Using jQuery to Preload Images with CSS and ...
    - Using Client-Side Scripting to Preload Image...
    - Removing Non-Semantic Markup when Preloading...
    - Using the Display CSS Property to Preload Im...
    - Preloading Images with CSS and JavaScript
    - Scaling and Moving Web Page Elements with th...
    - Fading, Hiding and Sliding HTML Elements wit...
    - Toggling CSS Properties with the GX JavaScri...
    - Cancel, Queue and Pause Animations with the ...
    - Producing Elastic Effects with the GX JavaSc...
    - Moving Divs Diagonally with the GX JavaScrip...
    - Moving Elements Vertically and Horizontally ...
    - Making Bouncing Effects in Parallel with the...
    - Creating Bouncing Effects with the GX JavaSc...
    - Manipulating Background Colors with the GX J...







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 7 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek