Example of sticky columns using flexbox.
A Pen by Justin Perry on CodePen.
Example of sticky columns using flexbox.
A Pen by Justin Perry on CodePen.
#[^\/\?]+ |
<.+?> | |
<a href="http://www.google.com">Google</a> | |
<a class="myclass" href="http://www.bbc.co.uk">BBC</a> | |
<a id="myid" href="http://www.yahoo.com" class="myclass">Yahoo</a> | |
<div><a href="http://www.google.com">Google</a></div> |
mystr.replace(/<%=.+?%>/g, function(a,b){ return a;}) |
Vanilla JS image slideshow with CSS3 transition
A Pen by Justin Perry on CodePen.
JavaScript class for creating simple charts in Canvas. Uses requestAnimationFrame for smooth animations and includes options for variable speed and multiple linear gradient stops. Includes HiDPI resize.
A Pen by Justin Perry on CodePen.
var history = []; | |
this.listenTo(this, 'route', function (name, args) { | |
history.push({ | |
name : name, | |
args : args, | |
fragment : Backbone.history.fragment | |
}); | |
}); |
function addClass(elem, newClass) { | |
var curClass = elem.className; | |
if(!new RegExp(newClass,'i').test(curClass)){ | |
if(curClass.length > 0 && curClass.charAt(curClass.length) === '') { | |
newClass = ' ' + newClass; | |
} | |
elem.className += newClass; | |
} | |
}; |
function delegateEvent(selector, handler) { | |
var that = this; | |
return function(e) { | |
var elem = e.target; | |
if(new RegExp(selector,'gi').test(elem.className)){ | |
if(typeof handler === 'function'){ | |
return handler; | |
} | |
} | |
return this; |
A Pen by Justin Perry on CodePen.