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}); |
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
// >> 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
// >> 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
// >> 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
// >> 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 >> Scroll Check >>>>>>>>>>>>>>>> | |
// prereq: debounce: https://github.com/cowboy/jquery-throttle-debounce | |
$(window).scroll($.debounce( 250, true, function(){ // +++ if scrolling | |
// do something | |
})); | |
$(window).scroll($.debounce( 250, function(){ // +++ if not... | |
// do something else | |
})); |
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
-webkit-transform: translate(-50%,-50%); | |
/* position:relative; top:0; Left:0; | |
margin: 0 0 0 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
// jquery >> Responsive Colorbox >>>>>>>>>>>>>>>> | |
(function($){ | |
// -- ColorBox Init -------------------------------------------------------------------------------------------------- | |
var resizeTimer, ct, winWidth = $(window).width(); | |
// | |
$(window).resize(function(){ | |
if (resizeTimer) ct = clearTimeout(resizeTimer); | |
resizeTimer = window.setTimeout(function() { | |
if ($('#cboxOverlay').is(':visible')) { |
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
1) edit the file as needed and back it up somewhere | |
2) physically delete the file in question (not the backup) | |
3) edit .gitignore and add path/filename.file | |
4) remove the file from git using git rm filename.file | |
5) git add / commit the change | |
6) copy / paste the backup back into the source folder | |
7) git status - if done correctly, git will no longer pick up the file | |
// this issue typically happens when you add a file to .gitignore after the file has already been checked in |
OlderNewer