Skip to content

Instantly share code, notes, and snippets.

View corydorning's full-sized avatar

Cory Dorning corydorning

View GitHub Profile
@corydorning
corydorning / gist:7087867
Created October 21, 2013 17:41
H5BP compatible VideoJS v4.2 CSS fix for IE6 and IE7. Reauthored for H5BP using doublex's fix here: https://github.com/videojs/video.js/issues/539
/*!
Video.js Default Styles (http://videojs.com)
Version 4.2.1
Create your own skin at http://designer.videojs.com
*/
/* SKIN
================================================================================
The main class name for all skin-specific styles. To make your own skin,
replace all occurances of 'vjs-default-skin' with a new name. Then add your new
skin name to your video tag instead of the default skin.
@corydorning
corydorning / delegate-selector
Created March 5, 2013 16:17
Access the delegated selector in jQuery
$(function(){
$('.foo').on('click', 'a', function(ev) {
// logs .foo as a jQuery object
console.log($(ev.delegateTarget));
});
});
@corydorning
corydorning / Accessing a jQuery selector inside a patched jQuery UI widget
Last active December 10, 2015 14:09
Boilerplate for adding a reference to the original jQuery selector used to instantiate a widget, which can then be accessed inside of a patched/custom jQuery UI method.
/* Extend a jQuery Selector to the Widget Options
* ===================================================
* Use: Boilerplate for adding a reference to the
* original jQuery selector used to instantiate a
* widget, which can then be accessed inside of a
* patched/custom jQuery UI method.
*
* Replace WIDGET with the name of the jQuery UI widget
* Replace METHOD with the name of the jQuery UI widget
* method you are patching
@corydorning
corydorning / Fullscreen iFrame
Last active October 7, 2015 19:58
Fullscreen iFrame
<iframe allowfullscreen="" webkitallowfullscreen="" mozallowfullscreen=""></iframe>
@corydorning
corydorning / Cross-Browser ::before and ::after pseudo-class polyfill
Last active February 18, 2022 00:24
Cross-Browser ::before and ::after pseudo-class polyfill
/* =============================================================================
CSS Declarations
========================================================================== */
/* ==|== The Standard Way =================================================== */
.foo::before {
/* ...css rules... */
}
@corydorning
corydorning / dialog._makedraggable
Created September 22, 2011 19:22
jQuery UI Dialog - Remove Containment
$.ui.dialog.prototype._makeDraggable = function() {
this.uiDialog.draggable({
containment: false,
handle: '.ui-dialog-titlebar'
});
};
@corydorning
corydorning / jq-clear-checkboxes.js
Created May 17, 2011 14:09
Uncheck checkboxes using jQuery
/*
* jQuery - Uncheck Checkboxes - 05/17/2011
* http://corydorning.com
*
* Dual licensed under 'Use it like you stole it'
* and 'I Don't Care'.
*
* Description: Uncheck any checkeboxes that might
* be checked. Simple, yet effective, particularly
* for how I needed to use it with AJAX.
@corydorning
corydorning / ie6-bgcache.js
Created May 17, 2011 13:26
Fix IE6 Background Caching
try {
$.browser.msie && $.browser.version < 7
&& document.execCommand( 'BackgroundImageCache', false, true );
} catch(e) { };
@corydorning
corydorning / jquery-stripeRows.js
Created May 12, 2011 15:53
Simple jQuery table striping
/*
* jQuery Table Striping - v0.1 - 05/12/2011
* http://corydorning.com, http://justinrains.com
*
* Dual licensed under 'Use it like you stole it'
* and 'We Don't Care'.
*
* Description: Stripe table rows easily by calling 'stripeRows'
* on any collection of <tr> elements and passing in the desired
* colors.