Quick jQuery code snippet to get the number of paragraphs in the specified element. The technique can be modified easily to get the number of any element.
Here are a few choice code snippets to truncate text with jQuery. Useful for fine-tuning responsive layouts, or just truncating strings of text in general.
When you load a page that contains a form, it may be useful to automatically place the user’s cursor in the first form field. This post explains how to do autofocus with jQuery.
Here is the basic code required for making a simple image slider. It provides a good starting point for rolling your own sliders, carousels, and so forth.
This code snippet is taken from my plugin, User Submitted Posts. It displays a link that users may click to add another file-upload input field.
This jQuery script displays a live preview of the currently selected images, as selected from a file input field.
jQuery makes it easy to do all kinds of cool stuff. For example, here is a code snippet to reload the current page with a click.
Internet Explorer has a nasty habit of displaying honking blue borders on linked images. This post shows a quick way to disable them using a slice of jQuery.
Here is a jQuery function for automatically setting the height of Ajax-loaded content.
I’ve integrated Google Custom Search at DigWP.com and Perishable Press. In doing so, I found it necessary to resize the google-search iframe in order to fit with the responsive layout.