jQuery 1.9 and greater

.attr() versus .prop() (read more) // Correct if changing the attribute is desired $(elem).attr("checked", "checked"); // Correct for checking the checkbox $(elem).prop("checked", true); // Correct if removing the attribute is desired $(elem).removeAttr("checked"); // Correct for clearing the checkbox $(elem).prop("checked", false);// Correct if changing the attribute is desired $(elem).attr("checked", "checked"); // Correct for checking the checkbox
Continue reading jQuery 1.9 and greater

ColorBox: a jQuery lightbox

ColorBox is a lightweight customizable lightbox plugin for jQuery. Supports photos, grouping, slideshow, ajax, inline, and iframed content Lightweight: 10KB of JavaScript (less than 5KBs gzipped) Appearance is controlled through CSS so it can be restyled Can be extended with callbacks & event-hooks without altering the source files Completely unobtrusive, options are set in the
Continue reading ColorBox: a jQuery lightbox

Capture a click outside a specific object

$(document).bind(’click’, function(event) { var $clicked = $(event.target); if (!($clicked.is(’#id’) || $clicked.parents().is(’#id’))) { // Do something } }); $(document).bind(‘click’, function(event) { var $clicked = $(event.target); if (!($clicked.is(‘#id’) || $clicked.parents().is(‘#id’))) { // Do something } });

Riloadr: cross-browser responsive images loader

Riloadr is a cross-browser framework-independent responsive images loader written in Javascript. The goal of this library is to deliver optimized, contextual image sizes in responsive layouts that utilize dramatically different image sizes at different resolutions in order to improve page load time. Features: No dependencies: Just Javascript, HTML and CSS Absolute control: Riloadr will process only
Continue reading Riloadr: cross-browser responsive images loader