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
/** | |
* uberGlobalize.js | |
* @version 3.0.0 | |
* @author Ray Peters <[email protected]> | |
* | |
*/ | |
(function( $ ) { |
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
var getDaysLeftInMonth = function(){ | |
var now = new Date(), | |
thisMonth = now.getMonth(), | |
thisYear = now.getFullYear(), | |
daysInThisMonth = new Date( thisYear, ( thisMonth + 1 ), 0 ).getDate(); | |
return ( daysInThisMonth - now.getDate() ); | |
}; |
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
/** | |
* @brief OPT Parallax | |
* @author Ray Peters <[email protected]> | |
*/ | |
;( function(){ | |
/* Configurations */ | |
var SETTINGS = { | |
BLOCKS_TO_MERGE: [ 2, 3 ], | |
BACKGROUND_IMAGE_URL: "https://i.ontraport.com/3.213.da5584f8a40b8a942445752f118aa207.JPEG" |
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
$.fn.isOnScreen = function(){ | |
var element = this.get( 0 ), | |
bounds = element.getBoundingClientRect(); | |
return ( ( bounds.top < window.innerHeight ) && ( bounds.bottom > 0 ) ); | |
}; |
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
var COUNT = 100, | |
links = [ | |
"http://www.quranjam.com/Jam/UserImages/whale.jpg", | |
"http://i633.photobucket.com/albums/uu56/cjay57/Creepy%20Fish/989826_f496.jpg", | |
"http://i.dailymail.co.uk/i/pix/2012/10/24/article-2222115-15A0CDA8000005DC-378_634x426.jpg", | |
"http://www.kidson66.com/Scout16.jpg", | |
"https://thejesterscorner.files.wordpress.com/2012/12/scary-whale.jpeg?w=1200", | |
"http://media.giphy.com/media/t5CTQBicJcWha/giphy.gif" | |
]; |
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
/* name your links like: http://mypage.com/jump-to-block-3 or http://mypage.com/jump-to-block-6 */ | |
/* place this in footer scripts */ | |
$( document ).ready( function() { | |
var $containers = $( ".row[opt-type='block']" ); | |
for ( var i = 0, l = $containers.length, deepLink; i < l; ++i ) { | |
deepLink = ( "op-container--" + i ); | |
$containers.eq( i ).attr( "id", deepLink ).attr( "name", deepLink ); | |
} |
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
/* place this in footer scripts */ | |
$( document ).ready( function() { | |
$(".container:has(form[action*='form_processor.php'])" ) | |
.attr( "id", "signup-form" ) | |
.attr( "name", "signup-form" ); | |
$( "a[href*='jump-to-signup-form']" ).attr( "href", "#signup-form" ); | |
} ); | |
/* name your link URL something like: http://jump-to-signup-form.com */ |
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
/** | |
* How to use: | |
* Step 1: Navigate to the given template you're curious about and paste this in the console. | |
* Step 2: ??? | |
* Step 3: Profit | |
* | |
* @author Jonathan Preston <[email protected]>, Ray Peters <[email protected]> | |
*/ |
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
$( document ).ready( function(){ | |
// Interesting thing happens when you have so many images on the page. | |
// Count them and wait for every onload event to fire. | |
var $images = $( "img" ), | |
imagesLoadedHandler = function(){ | |
var totalImagesToLoad = $images.length, | |
imageLoadedCount = 0; | |
return function(){ |
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(){ | |
// jQuery is required to run this snippet | |
// They are provided above from reliable CDNs if your page doesn't already have them added. | |
var _uberGlobalize = ( function(){ | |
var cloudFlareCDN = "//cdnjs.cloudflare.com/ajax/libs/globalize/0.1.1/cultures", | |
currentCulture = "", | |
previousCulture = "", | |
getCurrencySymbol = function( culture ) { | |
// Defaults to USD buck symbol |