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
// >> pass a string to the middle of a declared var >>>>>>>>>>>>>>>> | |
var n1x1, n1x2, n1y1, n1y2; | |
function someFunc(navNum){ | |
ctx.moveTo(eval(navNum+'x1'), eval(navNum+'y1')); | |
ctx.lineTo(eval(navNum+'x2'), eval(navNum+'y2')); | |
// ... | |
} |
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
// >> jQuery - Self invoke a standard function >>>>>>>>>>>>>>>> | |
(function (){ | |
alert('hello world'); | |
})(); |
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
// >> Skrollr.js LazyLoader >>>>>>>>>>>>>>>> | |
// prereq: throttle: https://github.com/cowboy/jquery-throttle-debounce | |
// note: throttle: when you want to receive constant data from the user | |
// debounce: when you want to wait for the user to be done | |
$(function(){ | |
var sec1 = $('#section-1'), | |
sec2 = $('#section-2'), |
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
// >> Horizontal Touch Scroll Simulator >>>>>>>>>>>>>>> | |
// prereq: skrollr.js: https://github.com/Prinzhorn/skrollr | |
function fakeHorzScroll(){ | |
var tStartX, tStopY, touch, mXPos, xPro; | |
$(window).bind('touchstart', function(e) { | |
tStartX = e.originalEvent.touches[0].pageX; | |
e.preventDefault(); |
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
// >> Pretty Resize >>>>>>>>>>>>>>>> | |
// prereq: debounce: https://github.com/cowboy/jquery-throttle-debounce | |
function prettyResize(){ | |
var a = '.element-1', // elements resizing | |
b = '.element-2', | |
c = '.element-3', | |
d = '.element-4', | |
rollout = $('' + a + ',' + b + ',' + c + ',' + d + ''); |
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
// >> jQuery - Dynamically center elements >>>>>>>>>>>>>>>> | |
var el_1 = $('.element-1'), | |
el_2 = $('.element-2'), | |
el_3 = $('.element-3'), | |
el_4 = $('.element-4'); | |
// -- X&Y --------------- | |
function XYmid(){ | |
el_1.css({'marginLeft' : el_1.outerWidth()/-2, 'marginTop' : el_1.outerHeight()/-2}); |
NewerOlder