Skip to content

Instantly share code, notes, and snippets.

View zizimoos's full-sized avatar

henry zizimoos

  • seoul Korea
View GitHub Profile
@zizimoos
zizimoos / helper.js
Created October 11, 2018 06:12 — forked from yamoo9/helper.js
helper.js
(function(global, document){
'use strict';
/* -----------------------------------------------------
* DOM 선택 헬퍼 함수 */
function els(selector, context) {
if (typeof selector !== 'string' || selector.trim().length === 0) { return null; }
context = !context ? document : context.nodeType === 1 ? context : el(String(context));
return context.querySelectorAll(selector);
@zizimoos
zizimoos / ajax.js
Created October 9, 2018 00:55 — forked from yamoo9/ajax.js
Ajax 심플 라이브러리 (수업용)
(function(global){
'use strict';
var JSON = global.JSON;
// @private
function whatType(o) {
return Object.prototype.toString.call(o).slice(8,-1).toLowerCase();
}
@zizimoos
zizimoos / dom.oo.js
Created October 8, 2018 07:04 — forked from yamoo9/dom.oo.js
DOM 스크립트 라이브러리 - 객체 지향 프로그래밍
(function(global, document){
// @private
function getStyle(el, prop, pseudo) {
return window.getComputedStyle(el, pseudo)[prop];
}
function setStyle(el, prop, value) {
return el.style[prop] = value;
}
@zizimoos
zizimoos / dom.fn.js
Created October 8, 2018 06:17 — forked from yamoo9/dom.fn.js
DOM 스크립트 라이브러리 - 함수형 프로그래밍
(function(global, document) {
'use strict';
var namespace = 'y9';
function el(selector, context) {
return (context || document).querySelector(selector);
}
function els(selector, context) {
return (context || document).querySelectorAll(selector);