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 class='container'> | |
<iframe src='video.mp4' frameborder='0'></iframe> | |
</div> | |
<style type='text/css'> | |
.container { | |
position: relative; | |
width: 100%; |
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
// Read the GET variables | |
var $_GET = {}; | |
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () { | |
function decode(s) { | |
return decodeURIComponent(s.split("+").join(" ")); | |
} | |
$_GET[decode(arguments[1])] = decode(arguments[2]); | |
}); | |
// Use the GET variables |
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
<script type='text/javascript' src="js/jquery.min.js"></script> | |
<script type='text/javascript'> | |
// Size the parent iFrame | |
function iframeResize() { | |
var height = $('body').outerHeight(); // IMPORTANT: If body's height is set to 100% with CSS this will not work. | |
parent.postMessage("resize::"+height,"*"); | |
} | |
$(document).ready(function() { | |
// Resize iframe |
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
function css(selector, property, value) { | |
for (var i=0; i<document.styleSheets.length;i++) { | |
try { document.styleSheets[i].insertRule(selector+ ' {'+property+':'+value+'}', document.styleSheets[i].cssRules.length); | |
} catch(err) {try { document.styleSheets[i].addRule(selector, property+':'+value);} catch(err) {}}//IE | |
} | |
} | |
// Example usage: | |
css('.header', 'border', '5px solid green'); |
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
// Check for IE | |
// ------------------------------------------------ | |
var ie = (function(){ | |
var undef; | |
var v = 3; | |
var div = document.createElement('div'); | |
var all = div.getElementsByTagName('i'); | |
while ( | |
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', |
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
// Convert CSV to JS Obj | |
function csvToObj(csv) { | |
var lines = csv.split("\n"); | |
var result = []; | |
var headers = lines[0].split(","); | |
for (var i = 1; i < lines.length; i++) { | |
var obj = {}; | |
var currentline = lines[i].split(","); |
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 to anchors | |
$(document).ready(function() { | |
$("a[href^=#]").click(function(e) { | |
e.preventDefault(); | |
var dest = $(this).attr('href').replace('#', ''); | |
$('html,body').animate({ scrollTop: $('[name='+dest+']').offset().top }, 'slow'); | |
}); | |
}); |