Events

Improved Animated Scrolling Script for Same-Page Links

After posting the last entry on animated scrolling with jQuery 1.2, I realized that I had left out an important piece of code. Actually, I didn't discover it until someone notified me that another page on the site was broken. Can you spot the problem(s)? [Note: the problem is not in line 3. The syntax […]
Read the rest of this entry »

Namespace Your Events

A common pattern in jQuery plugin development is the need to undo what the plugin has done. This is usually handled through a method prefixed with "un". Another common pattern is the use of anonymous functions for event handlers. Unbinding events is easy with jQuery but unbinding a single event handler requires the use of […]
Read the rest of this entry »

Quick Tip – Set Hover Class for Anything

Sometimes it's nice to be able to give users visual feedback when they hover their mouse over an element on the page. It's easy to do, of course, with a little CSS: #hover-demo1 p:hover { background: #ff0; } That little style rule changes the background of any paragraph that is a descendant of an element […]
Read the rest of this entry »

More Showing, More Hiding

We've received a number of comments recently from people looking for variations on the showing and hiding theme. For the basics, you can take a look at two earlier entries, Basic Show and Hide and Slicker Show and Hide. For a full-blown plugin solution with lots of options, look no further than Jörn Zaefferer's Accordion […]
Read the rest of this entry »

Copy Events from One Element to Another

Need to clone an element and its events? Sure, you could rebind the events after doing the clone, but that wouldn't be very DRY now, would it? Introducing Copy Events, a new plugin for jQuery.
Read the rest of this entry »

Really Simple Live Comment Preview

Introduction and Caveat I'm sure that some of you were expecting this entry to discuss traversing the DOM using jQuery methods. After all, I said I would do just that in my last entry. But a couple nights ago, I had the impulse to try a "live comment preview," so I'm going with it. My […]
Read the rest of this entry »

Responsive Menu
Add more content here...