Skip to content

Instantly share code, notes, and snippets.

@kflorence
kflorence / ieChangeFix.js
Created January 8, 2011 02:11
Fix for IE not firing the change event for certain inputs (namely, checkboxes and multiple select lists).
/**
* Fixes binding the "change" event to checkboxes and select[type=multiple]
* for Internet Explorer.
*
* @param {jQuery|Element|Element[]} elements
* The DOM Element we wish to bind the event to.
*
* @param {String} eventType
* The name of the event we want to bind to.
*
@kflorence
kflorence / jquery.plugin.js
Created November 17, 2010 01:43
jQuery plugin pattern
(function($) {
// $.widget-lite
$.plugin = function(name, base, prototype) {
if (!prototype) {
prototype = base;
base = function(options, element) {
if (arguments.length) {
$.data(element, name, this);
this.element = $(element);
this._init(options);