February 12th, 2008 by Karl Swedberg
jQuery has a nice selection of core animation effects, such as .show('speed') and .hide('speed'), .slideUp() and .slideDown(), and .fadeIn() and .fadeOut(). It even has a couple methods for toggling effects — the aptly named .toggle('speed') and .slideToggle().
All of these methods have optional speed, easing, and callback arguments — although a couple are special cases. The .show() and .hide() methods, when used without a speed, will immediately show and hide the matched set of elements with no animation. When the speed argument is included, the matched elements are shown and hidden gradually by animating their height, width, and opacity simultaneously. The .toggle() method shares its name with a method that takes two arguments that alternate being triggered. All of the other effect methods have a default speed of 400ms.
Read the rest of this entry »
Posted in Effects, Intermediate, Plugins, jQuery | 26 Comments »
January 4th, 2008 by Karl Swedberg
A week or so ago, someone posted a comment on one of my previous articles, asking if I could help her split up the textual content of an element, showing the first part and replacing the second with a link that, when clicked, would reveal the text. This behavior would appear in an FAQ using a definition list (<dl>), with each question contained in a <dt> and each answer contained in a <dd>. I soon realized that the solution would be rather involved, so I decided to create a new entry out of it rather than simply answer her question in another comment.
Here is the simple definition list structure that I’ll be using for the example:
Read the rest of this entry »
Posted in Beginner, DOM Modification, DOM Traversing, Intermediate, jQuery | 19 Comments »
December 19th, 2007 by Karl Swedberg
I’ve been feeling guilty lately about my lack of posts to this blog. But when I looked at my profile for the jQuery Google Group and discovered that for the past six months I’ve posted an average of 100+ times each month, well, I decided to give myself a break. Since I’m sure some people who stumble upon this blog aren’t subscribed to the Google group/mailing list, here are a few (edited) questions that have appeared there recently, along with my (edited) answers. I hope some of you find them helpful.
Read the rest of this entry »
Posted in Beginner, DOM Traversing, Plugins, jQuery | 22 Comments »
December 10th, 2007 by Brian Reindel
An excellent post by Mike Alsup described a plugin development pattern that has served him quite well over time. I have used BlockUI (an Alsup creation) on several projects, and it is readily apparent that Mike knows his stuff. The one thing I have always enjoyed and appreciated most about this particular plugin, however, is the simplicity of the implementation. You could argue that this was a creative decision, having little to do with the actual development. I will not speak for Mike, but for me the degree of simplicity is indeed one of the many creative decisions that I make every time I develop a jQuery plugin. Read the rest of this entry »
Posted in Plugins, jQuery | 4 Comments »
November 2nd, 2007 by Karl Swedberg
Quite a few jQuery tutorials have been posted around the web recently. It’s always great to see more people not only learning jQuery, but also teaching it to others. Here are just a few that I think could be helpful to readers of Learning jQuery:
Read the rest of this entry »
Posted in Announcement, jQuery | 17 Comments »
October 31st, 2007 by Karl Swedberg
Last week I attended The Ajax Experience conference in Boston (no, I didn’t go to a Red Sox game), sponsored by the folks at ajaxian.com The schedule was packed with outstanding presentations. But the highlight of my trip was jQueryCamp07, which was held at Harvard University on Saturday.
Throughout the week I had quite a few opportunities to talk with John Resig, the creator and lead developer of jQuery. But, like the social clod that I am, I forgot to do the one thing that I had set out to do: Thank John Resig, in person, for the jQuery JavaScript Library. It was only after I returned home on Sunday that I realized my oversight. So, at the risk of sounding sappy, I figure I ought to write in a public forum what I had meant to say face to face.
Read the rest of this entry »
Posted in Announcement, jQuery | 5 Comments »