A Pen by Charles Anifowose on CodePen.
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 scrollWatches = {}; | |
var setupScrollWatch = function(id, _el){ | |
if (!scrollWatches[id]){ | |
scrollWatches[id] = []; | |
} | |
if (_.indexOf(scrollWatches[id], _el) == -1){ | |
scrollWatches[id].push(_el); | |
$(_el).scroll(function(a,b){ | |
syncToScroll(id, _el); | |
}); |
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 deepDefault(obj, source, depth, blankCheck){ | |
if (depth===undefined){ | |
depth=0; | |
} | |
if (depth>1000){ | |
throw new Error('Too many iterations, possible circular reference'); | |
return; | |
} | |
_.each(source, function(sourceVal, i){ | |
var val = obj[i]; |