Archive for March, 2007

Learning jQuery, the Book

For those of you who have been following the jQuery blog the past couple months, you may have noticed John Resig’s mention of a secret: “There’s a jQuery book in the works!” Well, I am thrilled to be able to leak a little more information about that secret.

For the past few months my friend Jonathan Chaffer and I have been hard at work on the book, and everything is progressing well. Our writing is being supported by a stellar group of technical reviewers, some of whom are members of the jQuery development team. We’ll be able to divulge details about the book’s contents soon. The publisher is readying a web page for it, so as soon as that is completed, we can give you the full scoop.

About the Authors

Jonathan Chaffer is a long-time Drupal contributor and creator of Drupal’s CCK. He also likes to make up bizarre band names and album titles, based on snippets of conversations he overhears, at Tweak the Viking. Karl Swedberg (that’s me) is a jQuery zealot who runs the Learning jQuery blog and still tries to keep a bit of his former career as an English teacher alive at his other blog, English Rules. Jonathan and Karl work together at Structure Interactive in Grand Rapids, Michigan, where they have been given a lot of freedom to use jQuery, as well as standards-based, semantic HTML & CSS, in many of their projects.

Selecting Elements by Properties and DOM Expandos

Sometimes it is very convenient to store information on an element by using custom properties (DOM Expandos). For example, I use DOM Expandos in my Mouse Wheel plugin to store an array of handler methods (_mwHandlers) along with a method (_mwHandler) to call all those handlers when the mouse wheel is used. Storing these methods on the element allows me to write less code, and manage scope easier. It also gives me a function reference for easy removal when needed.

Now, what if I needed to select all elements that have a mouse wheel handler on them?

Read the rest of this entry »

Accordion Madness

A few weeks ago I wrote about two ways we can achieve the “accordion menu” effect, and I promised to describe a third option. Well, this is it, Option 3. But first, here is a list of my other show-hide-toggle entries, as well as Jörn Zaefferer’s accordion menu plug-in:

Read the rest of this entry »