This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence | |
(function(win, doc){ | |
if(win.addEventListener)return; //No need to polyfill | |
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}} | |
function addEvent(on, fn, self){ | |
return (self = this).attachEvent('on' + on, function(e){ | |
var e = e || win.event; | |
e.preventDefault = e.preventDefault || function(){e.returnValue = false} | |
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* insertAdjacentHTML.js | |
* Cross-browser full HTMLElement.insertAdjacentHTML implementation. | |
* | |
* 2011-10-10 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* viljamis.com/projects/ v1.6 | |
* http://viljamis.com | |
* Copyright (c) 2011-2012 @viljamis | |
*/ | |
// Get current position | |
function currentYPosition() { | |
// Firefox, Chrome, Opera, Safari | |
if (self.pageYOffset) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables | |
var hasTouch = false, | |
ua = navigator.userAgent, | |
docEl = document.documentElement; | |
// Clear html classes and add "js" class | |
docEl.className = ""; | |
docEl.className += " js"; | |
// Determine if the device supports touch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drop in replace functions for setTimeout() & setInterval() that | |
make use of requestAnimationFrame() for performance where available | |
http://www.joelambert.co.uk | |
Copyright 2011, Joe Lambert. | |
Free to use under the MIT license. | |
http://www.opensource.org/licenses/mit-license.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>2-column fluid masonry layout without JS plugins</title> | |
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> | |
<style> | |
body { | |
text-align: center; | |
padding: 3% 8%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasPlaceHolder() { | |
return 'placeholder' in document.createElement('input'); | |
} | |
function html5forms() { | |
var formPlaceholder = hasPlaceHolder(); | |
if (formPlaceholder === false) { | |
$('input[type=text]').each(function() { | |
if($(this).attr('placeholder')) { | |
var placeholderText = $(this).attr('placeholder'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Developed by Robert Nyman, http://www.robertnyman.com | |
Code/licensing: http://code.google.com/p/getelementsbyclassname/ | |
*/ | |
var getElementsByClassName = function (className, tag, elm){ | |
if (document.getElementsByClassName) { | |
getElementsByClassName = function (className, tag, elm) { | |
elm = elm || document; | |
var elements = elm.getElementsByClassName(className), | |
nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Responsive Nav with jQuery</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<link rel="stylesheet" href="styles.css"> | |
<script src="jquery.js"></script> | |
<script src="responsive-nav.js"></script> | |
<script src="responsive-slides.js"></script> |