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 hoverImage($image){ | |
var images = $('img'); | |
if(images == 1) { | |
clearTimeout(hoverImage); | |
} | |
for(var i=0,len=images.length;i<len;i=i+1) { | |
$(images[i]).trigger("mouseenter") | |
} | |
setTimeout(hoverImage,100); | |
}; |
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
<html> | |
<head> | |
<title>Facade Pattern</title> | |
</head> | |
<body> | |
<h1>Facade Pattern Example</h1> | |
<script type="text/javascript"> | |
!function (window, document) { | |
var module = window.module = {}, |
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
*.swp |
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 cards = document.querySelectorAll("section.game div.bottom"), | |
matches = {}; | |
for(var i=0;i<cards.length;i++) { | |
var item = cards[i].className.split(" ")[1]; | |
if(matches[item]) { | |
matches[item].click(); | |
cards[i].click(); | |
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
/* Closures and Scoping */ | |
!function(window) { | |
var body = window.getElementsByTagName('body')[0]; | |
console.log(body); | |
}(document); | |
/* | |
Q: What would you expect the value of body to be? |
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(){ | |
$('#variations-test .swatches a').hover(function(){ | |
$('#variations-test .variation-color').html( $(this).attr('data-color') ); | |
}, function() { | |
$('#variations-test .variation-color').html( $('#variations-test .swatches a.active').attr('data-color') ); | |
}); | |
}); |
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
<?php | |
// router.php | |
if (0 === strpos($_SERVER['REQUEST_URI'], '/bower_components/')) { | |
$this_page = $_SERVER['REQUEST_URI']; | |
if (strpos($this_page, "?") !== false) { | |
$exploded = explode("?", $this_page); | |
$this_page = reset($exploded); | |
} | |
readfile('..' . $this_page); |
OlderNewer