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() […]