jQuery fans blog and community sharing news, plugins, video tutorials, demos and more.

50 jQuery Function Demos now on GitHub

50 jQuery Function Demos now on GitHub – Complete code for the Smashing Magazine Post! I have added the complete code listing to GitHub in a bid to get the demos working with the latest versions of jQuery – Back in 2011 the code was…

Continue reading →

Backwards Support for $.live() and $.browser()

Quick code snippets from the jQuery Migrate Plugin. I recommend using the full migrate plugin but if you want specifics for $.live() and $.browser() see below. var oldLive = jQuery.fn.live; jQuery.fn.live = function( types, data, fn ) {     // migrateWarn("jQuery.fn.live() is deprecated");  …

Continue reading →

jQuery $(‘body’).on() vs $(‘document’).on()

With the new jQuery function .on() replacing .live() I’ve seen several different ways to use it. Here I take a look at the main difference between using body or document as the bound element in event delegation. If your new to event delegation it provides…

Continue reading →

Use jQuery’s $.closest() vs $.parents()

So I guess you should consider using $.closest() instead of $.parents(). But first, as always you need to know what your dealing with – the key difference between them. .closest() .parents() Begins with the current element Begins with the parent element Travels up the DOM…

Continue reading →

Do I use .size() or .length in Javascript?

Do I use .size() or .length in Javascript? Let’s have a closer look… .size() simply calls .length (clearly shown this in the jQuery source code below) so we are saving a function call //http://code.jquery.com/jquery-latest.js // The number of elements contained in the matched element set…

Continue reading →

Page 1 of 11 1 2 3 4 5 ... Last →
scroll to top