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
var terms = { | |
"terms" : { | |
Lorem : { | |
"term": "Lorem", | |
"definition" : "Lorem: Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | |
}, | |
ullamco : { | |
"term": "ullamco", | |
"definition" : "ullamco: Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | |
}, |
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
<div id="main"> | |
<div id="head-neck-body"> | |
<div id="head-neck"> | |
<div id="head"> | |
<div class="shape02"></div> | |
<div class="shape0"></div> | |
<div class="shape01"></div> |
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
/* | |
This is based on the assumption that the .pop-background element is inserted into the DOM at the bottom of the page after initial page load when the modal is initiated on click. | |
*/ | |
.pop-background { | |
/* Works when inserted into the DOM after page load. Data-uri's work as well as hosted images. */ | |
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA9JREFUeNpiYGBgiAEIMAAAYQBdPMcrbwAAAABJRU5ErkJggg==") 0 0 repeat; | |
/* | |
Does not work when inserted after the DOM is initially loaded for the first time. The element will have no opacity filter applied. | |
background: black; |
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
// WORKS FF, Chrome, Safari, IE 8 & 9 etc... | |
$('.extra-content .graphics img').load(function() { | |
$(this).css('marginTop', $(this).parents('.graphics').height() / 2 - $(this).height() / 2 ); | |
}); | |
// DOESN'T WORK IE8 & 9 | |
// With multiple images on a page this script seems unable to compute the marginTop var. | |
// However placing it directly into the CSS method works as shown above. | |
$('.extra-content .graphics img').load(function() { | |
var marginTop = $(this).parents('.graphics').height() / 2 - $(this).height() / 2; |
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
// Checking execution order based on document and window ready / load state within a Facebook iFrame canvas ( page tab or app). | |
// Executes 1st | |
// Same as $(document).ready(function(){}); | |
$(function() { | |
alert('1'); | |
}); | |
// Executes 2nd | |
$(window).load(function() { |
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
window.onload = function() { | |
FB.Canvas.setSize({ height: $(window).outerHeight() }); | |
} | |
window.onload = function() { | |
setTimeout(function(){ | |
FB.Canvas.setAutoGrow(); | |
},1000); | |
} |
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> | |
<head> | |
<script type="text/javascript" src="processing.js"></script> | |
</head> | |
<body> | |
<div class="learning-demo"> | |
<script type="application/processing"> |
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" style="overflow: hidden"> | |
<body style="overflow:hidden"> | |
<head> | |
<!-- You need to include jquery & FBSDK--> | |
</head> | |
<body> | |
<div id="fb-root"></div> | |
<script> | |
window.fbAsyncInit = function() { |
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
var tag = document.createElement('script'); | |
tag.src = "//www.youtube.com/iframe_api"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
var player; | |
function onYouTubeIframeAPIReady() { | |
player = new YT.Player('player', { | |
height: '254', | |
width: '451', |
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
Highwire.prototype._trackVideoPlays = function(){ | |
// Gets reference to the Vimeo video player | |
var f = $('#VimeoPlayer'), | |
url = f.attr('src').split('?')[0]; | |
// Listen for messages from the player | |
if (window.addEventListener){ | |
window.addEventListener('message', onMessageReceived, false); | |
} else { |