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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<title>JavaScript SpatialNavigation Demo Page</title> | |
<script> | |
function isElementInViewport (el) { | |
//special bonus for those using jQuery |
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
// Example 1 | |
mediator.name = 'Doug'; | |
mediator.subscribe('nameChange', function(arg){ | |
console.log(this.name); | |
this.name = arg; | |
console.log(this.name); | |
}); | |
mediator.publish('nameChange', 'Jorn'); |
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
@mixin center($width, $height) { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
height: $height; | |
width: $width; | |
margin-left: - $width / 2; | |
margin-top: - $height / 2; | |
} |