jQuery: Shuffle Plugin

I recently came across a really compact array shuffling function on JSFromHell.com, which I thought would make a nifty jQuery plugin. This jQuery shuffle plugin could be applied to any HTML element or Array object. (function($){ $.fn.shuffle = function() { return this.each(function(){ var items = $(this).children(); return (items.length) ? $(this).html($.shuffle(items)) : this; }); } $.shuffle [...]

JavaScript: Event Delegation

Recently, I’ve been hearing much about event delegation. Many new to this concept seem to be baffled by the term. However, it really is a simple idea when you realise what’s involved. Put simply, event delegation is the practice of directing events on parent DOM elements who then listen on their children for events. To [...]

jQuery UI Spinner

After contributing jQuery Numeric Stepper to the jQuery UI community. Paul Bakaus kindly asked whether I’d like to merge it with the official jQuery UI Spinner, of which I was more than happy to do out of pure love for jQuery. The jQuery UI Spinner widget will be available with the soon to be released [...]

jQuery: outerHTML

The outerHTML property (IE only) could sometimes be very handy, especially if you’re trying to replace an element entirely. Brandon Aaron has very kindly given us a outerHTML plugin that does half the job as it doesn’t support replacements. The following code snippet fills in the blanks: jQuery.fn.outerHTML = function(s) { return (s) ? this.before(s).remove() [...]

jQuery Numeric Stepper

As an experiement I ported over my Accessible Numeric Stepper into a jQuery widget and added some accessibility enhancements and new features in the process. This widget utilises ui.core.js – a factory method object for creating widget classes. Widgets in jQuery are essentially plugins at heart but built to follow stricter coding standards in order [...]

Loving jQuery

In recent weeks I have come to love jQuery. jQuery is this lightweight, elegant and so-much-fun-to-code-with JavaScript library. You may already have it in your source code if you’re using either the latest version of WordPress or Drupal. jQuery is so easy to get to grips with, the documentation is simple to follow and complete [...]