Using setTimeout to Delay Showing Event-Delegation Tooltips

In my last two tutorials, I explained how to use event delegation for showing and hiding tooltips. In a comment on the first one, Jan Aagaard asked how we might go about enhancing the script by adding a small delay before showing a tooltip. The answer lies with two JavaScript functions, setTimeout() and clearTimeout().
Read the rest of this entry »

Binding Multiple Events to Reduce Redundancy with Event-Delegation Tooltips

Last time I showed how to use event delegation to create a simple tooltip for a huge number of elements without running into the problem of binding an event handler to all of those elements. In this tutorial, I'm going to refine that tooltip script a bit, avoiding some code repetition and fixing a bug […]
Read the rest of this entry »

Working with Events, Part 3: More Event Delegation with jQuery

Event delegation, as described in the first article of this series, is a way to take advantage of event bubbling to avoid binding an event listener more than once. jQuery 1.3 and the upcoming jQuery 1.4 have many features that make using event delegation in your web pages easier. The aim of this tutorial is […]
Read the rest of this entry »

Tab Navigation with Smooth Horizontal Sliding Using jQuery

In this tutorial I'll show you how to create a navigation menu that slides horizontally. It begins with a set of "tabs" on the right side of a containing element. When clicked, a tab slides to the left to reveal a group of links. Click the tab again, and it slides back. While I've never […]
Read the rest of this entry »

Shorthand methods for unbind

Someone sent me an email the other day, asking that I add shorthand methods for .unbind(eventType) to the jQuery core file. He argued that since jQuery provides shorthands such as .click() for .bind('click'), it should also include .unclick() for .unbind('click') for consistency. But he didn't consider two things: I can't change jQuery's API. Those shorthand […]
Read the rest of this entry »

Quick Tip: Outline Elements on Hover

Someone on the jQuery Google Group yesterday asked about how to display a border around elements on hover. Here is a quick script I wrote to achieve that effect:
Read the rest of this entry »

Responsive Menu
Add more content here...