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
// Check to see if an element is in the viewport | |
function elementInViewport(el) { | |
var top = el.offsetTop; | |
var left = el.offsetLeft; | |
var width = el.offsetWidth; | |
var height = el.offsetHeight; | |
while (el.offsetParent) { | |
el = el.offsetParent; | |
top += el.offsetTop; |
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 ModuleExample = { | |
init: function() { | |
var _self = this; | |
var varExample = $('form.variations_form'); | |
function exampleFunction() { | |
console.log(this); | |
} | |
} | |
}; |
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 CoolModule() { | |
var something = "cool"; | |
var another = [1, 2, 3]; | |
function doSomething() { | |
console.log( something ); | |
} | |
function doAnother() { | |
console.log( another.join( " ! " ) ); |
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 | |
/** | |
* List Users Alphabetically | |
* | |
* Create a list of all authors of a WordPress blog. | |
* Names are grouped by first name with a single letter | |
* as a header character. | |
* | |
* Call the function with <?php ngtj_list_users_alphabetically(); ?> |
NewerOlder