Skip to content

Instantly share code, notes, and snippets.

View jasonbellamy's full-sized avatar

Jason Bellamy jasonbellamy

View GitHub Profile
@jasonbellamy
jasonbellamy / disable-hover
Created August 18, 2014 13:34
Disable hover on scroll
// Used to track the enabling of hover effects
var enableTimer = 0;
/*
* Listen for a scroll and use that to remove
* the possibility of hover effects
*/
window.addEventListener('scroll', function() {
clearTimeout(enableTimer);
removeHoverClass();
.element-to-clearfix
*zoom: 1
&:before,
&:after
content: ''
display: table
&:after
clear: both
@jasonbellamy
jasonbellamy / timed_event_manager.js
Created November 13, 2012 16:12
Simple timed event manager
/**
* Handles set up / clean up of multiple named event timers
* @constructor
*/
var TimedEventManager = function () {
this.timers = {};
};
TimedEventManager.prototype = {
@jasonbellamy
jasonbellamy / featuretest.js
Created November 7, 2012 19:35
Simple JavaScript feature detection.
var testFeature = (function () {
return {
/**
* Accepts a feature name and feature test function to test for truthness
* @param {String} featureName of the feature being tested
* @param {Function} testMethod the feature test method ( this should always return true or false )
*/
addTest: function( featureName, testMethod ) {
/**
* @name EventViewFactory
* @constructor
*/
var EventViewFactory = function() {
return {
/**
* @name create