This file contains hidden or 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
<div id="wrapper"> | |
<div id="container"></div> | |
<p>Scroll Down</p> | |
</div> | |
<div id="content"> | |
</div> |
This file contains hidden or 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
$.fn.randomize = function(selector, callback) { | |
var $elems = selector ? $(this).find(selector) : $(this).children(), | |
$parents = $elems.parent(); | |
$parents.each(function() { | |
$(this).children(selector).sort(function() { | |
return Math.round(Math.random()) - 0.5; | |
// }). remove().appendTo(this); // 2014-05-24: Removed `random` but leaving for reference. See notes under 'ANOTHER EDIT' | |
}).detach().appendTo(this); | |
}); |
This file contains hidden or 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
// ImageMagick - Convert SVG to PNG w/ transparency | |
// | |
// - open terminal | |
// | |
// - confirm you have imagemagick installed | |
// --- type: convert -v | |
// | |
// - cd to folder | |
// | |
// - single file |
This file contains hidden or 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
/* global Modernizr */ | |
(function (app, $, window, document, undefined) { | |
/* SHIM: <input> placeholder shim | |
--------------------------------------------------------------------------- */ | |
if(!Modernizr.input.placeholder){ | |
$(document).on('focus', 'input[placeholder], textarea[placeholder]', function() { | |
var input = $(this); | |
if (input.val() === input.attr('placeholder')) { | |
input.val('').removeClass('placeholder'); | |
} |
This file contains hidden or 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> | |
<head> | |
<title>CSS animations: Example 1</title> | |
<style type="text/css"> | |
body { | |
padding: 20px; | |
} |
This file contains hidden or 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
document.write(new Date().getFullYear()); |
This file contains hidden or 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
.block:before { | |
border: none; | |
width: 0; | |
} |
This file contains hidden or 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
var cache = {}; | |
function getData( val ){ | |
// Return a promise from the cache (if available) | |
// or create a new one (a jqXHR object) and store it in the cache. | |
var promise = cache[val]; | |
if (!promise) { | |
promise = $.ajax('/foo/', { | |
data: { value: val }, |
This file contains hidden or 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
$(".scroll").click(function(event){ | |
event.preventDefault(); | |
//calculate destination place | |
var dest=0; | |
if($(this.hash).offset().top > $(document).height()-$(window).height()){ | |
dest=$(document).height()-$(window).height(); | |
}else{ | |
dest=$(this.hash).offset().top; | |
} | |
//go to destination |
This file contains hidden or 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
if (!window.addEventListener) { | |
// DO NOTHING | |
//window.attachEvent("orientationchange", resizeColorBox); | |
} | |
else { | |
window.addEventListener("orientationchange", resizeColorBox, false); | |
} | |