Events

Sacrificial Lambda

Dynamically binding event handlers to content that has been ajaxed in with $.load without repeating yourself can be tricky. Lambda functions help you to not repeat yourself as much. jQuery uses lamdba functions everywhere, so if you're familiar with jQuery, you should be familiar with the syntax of lambda functions. In this example, the ajaxed-in […]
Read the rest of this entry »

Introducing $(document).ready()

This is the first thing to learn about jQuery: If you want an event to work on your page, you should call it inside the $(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page contents are loaded.
Read the rest of this entry »

Multiple $(document).ready()

One more great thing about $(document).ready() that I didn't mention in my previous post is that you can use it more than once. In fact, if you don't care at all about keeping your code small, you could litter your javascript file with them. It's great to be able to group your functions within a […]
Read the rest of this entry »

Scroll Up Headline Reader

A couple weeks ago someone on the jQuery discussion list asked if someone could reproduce a rotating headline box in which the headlines, in succession, scroll up into the box, pause, and then scroll up out of the box. Since I already had some code for rotating images on a page, I decided to recycle […]
Read the rest of this entry »

Quick Tip – Blurring Links

Warning Using JavaScript to blur clicked links is NOT recommended because it interferes with basic accessibility, especially for those using keyboard navigation or other assistive technologies With all the fun new things you can do using jQuery and other JavaScript libraries, people are using links ("a" tags) for much more than sending users to a […]
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 »