Home arrow JavaScript arrow Using the Interval Argument of the HoverIntent jQuery Plug-in
JAVASCRIPT

Using the Interval Argument of the HoverIntent jQuery Plug-in


In this third part of the series, you will learn how to modify the default polling interval of “hoverIntent” by means of the “interval” option. The straightforward process means you shouldn't have major trouble using this argument when coding your own delayed rollovers.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
June 01, 2010
TABLE OF CONTENTS:
  1. · Using the Interval Argument of the HoverIntent jQuery Plug-in
  2. · Review: the sensitivity argument
  3. · Modifying polling intervals with the interval argument
  4. · Including the JavaScript in a web page

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Using the Interval Argument of the HoverIntent jQuery Plug-in
(Page 1 of 4 )

The well-deserved popularity that jQuery has gained in the last couple of years isn't just because of its  renowned capabilities and its flat learning curve. The flexible model provided by the library allows developers to easily extend its core functionality via additional plug-ins, which come in all sorts of sizes and flavors.

Among the variety of jQuery plug-ins available today, there's one that you'll probably find especially interesting for your daily tasks. Through a simple API, it will let you build rollover effects where the "mouseover" and "mouseout" events can be controlled via a set of configurable options. Yes, as you might already have guessed, I'm talking about "hoverIntent," a cool plug-in developed by Brian Cherne which can be used for implementing rollovers on web pages that deliberately delay the triggering of mouse events according to the user's intention (hence the plug-in name).

Put in a simple way, what "hoverIntent" does is wait long enough before firing up the events, based on a combination of parameters that it uses internally, including the mouse's coordinates, the frequency these coordinates are recorded and compared (a process called polling intervals) and the number of pixels that the mouse is moved across the targeted web page element.

Naturally, simply explaining the benefits offered by the plug-in needs to be properly complemented with some functional code. In previous installments of the series I developed some basic examples that demonstrated how to use the plug-in for creating a delayed rollover using a single div. I also showed how to customize the default behavior of "hoverIntent" via its "sensitivity" argument; that topic was covered in depth in the last chapter.

However, it's valid to point out that there's plenty of ways to tweak how "hoverIntent" does its thing. It provides a few additional parameters which can be used for fine-tuning certain aspects of its behavior. Therefore, in this third part of the series I'm going to discuss how to use the plug-in's "interval" option, which is a very straightforward process.

Now, it's time to discover some extra capabilities that the "hoverIntent" plug-in hides under the hood. Let's jump in!


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 9 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials