JSFiddle - React, Tailwind, and code Playground
by seong gyun jeon
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style type="text/css">
html{
margin:0;
padding:0;
}
body{
width:100%;
height:100%;
}
</style>
<link href="http://oridomi.com//css/demo.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
var Event = (function (win, doc) {
var $this = null;
return new (function () {
function init() {
$this = this;
return this;
}
init.prototype = {
on: on,
ready: ready,
bind: bind,
unbind: unbind,
stopDefault: stopDefault,
stopPropagation: stopPropagation,
relatedEventBind: relatedEventBind
};
return init;
} ());
// 이벤트 할당
function on(elem, type, arg1, arg2) {
elem = elem || document;
type = typeof type === 'string' && type || '';
var handler;
handler = arg1 = typeof arg1 === 'string' ? arg1 : typeof arg1 === 'function' ? arg1 : null;
if (arg2) handler = arg2 || function () { };
bind(elem, type, function (e) {
handler.call(elem, e);
// 할당된 Tag Element를 감시하고 해당 이벤트를 할당한다.
var elems = elem.getElementsByTagName(arg1);
for (var i = 0, length = elems.length; i <...