hoverIntent is a plug-in that attempts to determine the user’s intent… like a crystal ball, only with mouse movement! It works like (and was derived from) jQuery’s built-in hover. However, instead of immediately calling the onMouseOver function, it waits until the user’s mouse slows down enough before making the call. Why? To delay or prevent the accidental firing of animations or ajax calls. Simple timeouts work for small areas, but if your target area is large it may execute regardless of intent.
var config = { over: makeTall, // function = onMouseOver callback (REQUIRED) timeout: 500, // number = milliseconds delay before onMouseOut out: makeShort // function = onMouseOut callback (REQUIRED) }; $("#demo3 li").hoverIntent( config )
mouseover with delay (using hoverIntent plugin)
hoverIntent is a plug-in that attempts to determine the user’s intent… like a crystal ball, only with mouse movement! It works like (and was derived
Related posts
JavaScript
How to Create an Ajax-Based Yii Login Form Without Page Refresh
AjLearn how to create an AJAX-based Yii 1.1 login form without a full page refresh. This step-by-step guide explains how to use CActiveForm validation, the afterValidate callback, jQuery AJAX, and Yii controllers to validate credentials, authenticate users, handle errors, and redirect users with a JSON response.
JavaScript
nl2br equivalent JavaScript function
Learn how to create an <code>nl2br()</code> equivalent in JavaScript to convert newline characters into HTML line breaks. This guide covers simple JavaScript functions, PHP-to-JavaScript conversion, textarea handling, different newline formats, secure DOM methods, CSS alternatives, and important XSS considerations when working with user-generated content.
JavaScript
Style file upload field
Learn how to transform a standard HTML file upload field into a stylish and user-friendly upload control using jQuery File Style. This guide covers the required jQuery files, implementation steps, customization options, multiple file inputs, and important file upload considerations.