Skip to content

Instantly share code, notes, and snippets.

View adamjmcintyre's full-sized avatar

Adam J. McIntyre adamjmcintyre

View GitHub Profile
@adamjmcintyre
adamjmcintyre / gist:3098766
Created July 12, 2012 15:15
Using CSS keyframe animationend event cross-browser with jQuery
$('.some-els').bind('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){
// Do something!
$(this).removeClass('animation-class');
})
.addClass('animation-class');
// One works, too
$('.some-els').one('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){
// Do something once!
console.log('this would show once');
@adamjmcintyre
adamjmcintyre / strict-boilerplate
Created May 11, 2012 14:47
Boilerplate for creating namespaced modules in js strict mode
;(function(win, $){
"use strict";
// Check to see if our global is available as a member of window; if it is, our namespace root exists; if not, we'll create it.
var foospace = win.foospace = (typeof win.foospace !== "undefined") ? win.foospace : {};
(foospace.module = function(){
return{
_init : function(){
// Etc. etc.
(function($){
var rupper = /([A-Z])/g;
// ----------
// Function: stopCssAnimation
// Stops an animation in its tracks!
$.fn.stopCssAnimation = function(){
this.each(function(){
// When you remove the CSS Transition properties