Code
-
Detect Window Scroll Down / Up, 스크롤 Y 방향 탐지Code 2019. 6. 17. 16:09
var $window = window.$window || $(window), $document = window.$document || $(document), $html = window.$html || $('html'); var throttle = function(fn, threshhold, scope) { // throttle threshhold || (threshhold = 250); var last, deferTimer; return function() { var context = scope || this; var now = +new Date, args = arguments; if (last && now < last + threshhold) { // hold on to it clearT..
-
Relative StickyCode 2019. 6. 13. 13:48
See the Pen relative sticky by richard park (@riix) on CodePen.
-
자주 쓰는 Javascript 함수 모음Code 2019. 5. 30. 14:08
hyphenate, 하이픈 변환 ;(function(global){ global.hyphenate = function(_value) { // camelCase to hypen pattern, hyphenate(key) var cache = {}; var replacer = function(_match) { return '-' + _match[0].toLowerCase(); }; return cache[_value] || (cache[_value] = _value.replace(/([A-Z])/g, replacer)); } global.round = function(n) { // 소숫점 4자리 return Math.round(n * 10000) / 10000; } global.random = functio..
-