{"id":2459,"date":"2008-12-03T03:34:44","date_gmt":"2008-12-03T03:34:44","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=2459"},"modified":"2008-12-03T03:34:44","modified_gmt":"2008-12-03T03:34:44","slug":"%ed%8e%8c-%eb%a7%88%ec%9a%b0%ec%8a%a4-%ec%a0%9c%ec%8a%a4%ec%b2%98-js","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=2459","title":{"rendered":"[\ud38c] \ub9c8\uc6b0\uc2a4 \uc81c\uc2a4\ucc98 &#8211; js"},"content":{"rendered":"<p><TABLE cellSpacing=0 cellPadding=0 width=\"100%\" align=center bgColor=#3b6ea5><br \/>\n<TBODY><br \/>\n<TR height=28><br \/>\n<TD style=\"PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px\" align=middle width=634 background=..\/skin\/board\/basic_license\/img\/title_main_bg.gif bgColor=#f8f8f9><STRONG>[\uc2a4\ud06c\ub9bd\ud2b8] [JS] Mouse Gesture<\/STRONG> <\/TD><br \/>\n<\/TR><\/TBODY><\/TABLE><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" align=center bgColor=#3b6ea5><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<\/TR><br \/>\n<TR height=28><br \/>\n<TD align=middle width=78 bgColor=#35689d><IMG src=\"http:\/\/phpschool.com\/gnuboard4\/skin\/board\/basic_license\/img\/dot_icon.gif\" align=absMiddle> \uae00\uc4f4\uc774<\/TD><br \/>\n<TD id=bb_view width=213>&nbsp; <IMG src=\"http:\/\/phpschool.com\/images\/level_image\/level_35.gif\" align=absMiddle border=0><IMG src=\"http:\/\/phpschool.com\/images\/level_image\/level2_3.gif\" align=absMiddle border=0><IMG src=\"http:\/\/phpschool.com\/images\/3px_space.gif\" align=absMiddle border=0><SPAN class=member title=Seeker onclick=\"showSideView(this, 'hwangkw', 'Seeker');\">Seeker<\/SPAN><\/TD><br \/>\n<TD align=middle width=78 bgColor=#35689d><IMG src=\"http:\/\/phpschool.com\/gnuboard4\/skin\/board\/basic_license\/img\/dot_icon.gif\" align=absMiddle> \ub0a0 \uc9dc<\/TD><br \/>\n<TD align=middle width=118>08-10-30 21:25<\/TD><br \/>\n<TD align=middle width=78 bgColor=#35689d><IMG src=\"http:\/\/phpschool.com\/gnuboard4\/skin\/board\/basic_license\/img\/dot_icon.gif\" align=absMiddle> \uc870 \ud68c<\/TD><br \/>\n<TD align=middle width=75>823<\/TD><\/TR><br \/>\n<TR><br \/>\n<\/TR><br \/>\n<TR><br \/>\n<\/TR><br \/>\n<TR height=28><br \/>\n<TD align=middle width=78 bgColor=#35689d><IMG src=\"http:\/\/phpschool.com\/gnuboard4\/skin\/board\/basic_license\/img\/dot_icon.gif\" align=absMiddle> Link1<\/TD><br \/>\n<TD id=bb_view width=562 colSpan=5>&nbsp; <a href=\"http:\/\/phpschool.com\/gnuboard4\/bbs\/link.php?bo_table=tipntech&amp;wr_id=63860&amp;no=1&amp;page=3\" target=\"_blank\" rel=\"noopener noreferrer\"><STRONG>http:\/\/www.seeker.kr\/test\/mouse_gesture.html<\/STRONG> (258)<\/A><\/TD><\/TR><br \/>\n<TR><br \/>\n<\/TR><br \/>\n<TR><br \/>\n<TD style=\"WORD-BREAK: break-all\" colSpan=6 height=150><br \/>\n<TABLE style=\"TABLE-LAYOUT: fixed; OVERFLOW: hidden; WORD-BREAK: break-all; WORD-WRAP: break-word\" cellSpacing=0 cellPadding=0 width=620 align=center><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<\/TR><br \/>\n<TR><br \/>\n<TD id=bb_view><FONT color=#ffffff>\ub9c8\uc6b0\uc2a4 \uc81c\uc2a4\ucc98, \uc989 \ub9c8\uc6b0\uc2a4\uc758 \uc774\ub3d9\uc73c\ub85c \uc9c0\uc815\ud55c \ub3d9\uc791\uc744 \uc2e4\ud589\ud558\ub294 \uae30\ub2a5\uc785\ub2c8\ub2e4. <BR><BR>FF\ub294 \uc774 \uae30\ub2a5\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ubd80\uac00\uae30\ub2a5\uc774 \uba87\uac1c \uc788\uace0, \uc544\uc608 \uc81c\uc2a4\ucc98 \uae30\ub2a5\uc774 \uae30\ubcf8\uc73c\ub85c \ub0b4\uc7a5\ub41c \ube0c\ub77c\uc6b0\uc800\ub3c4 \uc788\uc9c0\ub9cc IE\ub294 \uc804\ud600 \uc0c1\uad00\uc5c6\uae30 \ub54c\ubb38\uc5d0&#8230; <BR><BR>\ub2e8\ucd95\ud0a4 \uae30\ub2a5\uc744 \ub9cc\ub4e4\uace0 \ub09c \ub4a4 \ubb38\ub4dd \uc774\uac83\ub3c4 \uc788\uc73c\uba74 \ud3b8\ub9ac\ud558\uaca0\ub2e4 \uc2f6\uc5b4\uc11c \ub9cc\ub4e4\uc5b4 \ubd24\uc2b5\ub2c8\ub2e4. <BR><BR><BR>_gestures \uc5d0 \ub3d9\uc791\uacfc \ud568\uc218\ub97c \uc9c0\uc815\ud558\uba74 \ub429\ub2c8\ub2e4. <BR><BR><BR>\ub9c1\ud06c\ub41c \ud398\uc774\uc9c0\uc5d0\uc11c \uac04\ub2e8\ud55c \ub3d9\uc791\uc744 \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <BR><BR><BR># \ub3d9\uc791 : U(up) \/ D(down) \/ R(right) \/ L(left) \uc758 4\uac00\uc9c0 \ubc29\ud5a5\uc73c\ub85c \uad6c\uc131 <BR><BR># \ub2e8\uacc4 \uc81c\ud55c\uc740 \uc5c6\uc74c. (\ud558\uc9c0\ub9cc \ub9ce\uc544\ub3c4 3\ub2e8\uacc4 \uc774\ud558\ub85c \uc9c0\uc815\ud558\ub294\uac8c \uc0ac\uc6a9\uc5d0 \ud3b8\ub9ac) <BR><BR># 20\ud53d\uc140 \uc774\uc0c1\uc758 \ub3d9\uc791\ub9cc \uc778\uc2dd (\uc778\uc2dd \uae38\uc774 \uc870\uc815 \uac00\ub2a5) <BR><BR># \ubc29\ud5a5 \uad6c\ubd84\uc740 60\ub3c4, \uc989 \uc218\uc9c1\uc5d0\uc11c \uc88c\uc6b0 30\ub3c4(\ud569 60\ub3c4) \uc774\ub0b4\uc758 \ubc94\uc704\ub97c \uc9c0\ub098\uba74 U \ud639\uc740 D\uc774\uace0 \uc218\ud3c9\uc5d0\uc11c \uc0c1\ud558 30\ub3c4 \uc774\ub0b4\uc758 \ubc94\uc704\ub97c \uc9c0\ub098\uba74 R \ud639\uc740 L \ud310\uc815 (\ubc94\uc704 \uc870\uc815 \uac00\ub2a5) <BR><BR><BR># IE6\/7, FF3, \ud06c\ub86c\uc5d0\uc11c \ud14c\uc2a4\ud2b8\ud588\uc2b5\ub2c8\ub2e4. <BR><BR><BR><BR><BR>\/* <BR>\uc774 \uc2a4\ud06c\ub9bd\ud2b8\uc5d0 \ub300\ud55c \ubaa8\ub4e0 \uad8c\ub9ac\ub294 \uc81c\uc791\uc790\uc5d0\uac8c \uc788\uc2b5\ub2c8\ub2e4. <BR>\uc2a4\ud06c\ub9bd\ud2b8\ub97c \uc774\uc6a9\ud558\ub824\uba74 \uc81c\uc791\uc790\ub97c \ubc18\ub4dc\uc2dc \ud45c\uae30\ud574\uc57c \ud569\ub2c8\ub2e4. <BR><BR>\uc81c\uc791\uc790 : Seeker <BR>\uc81c\uc791\uc790 \ud648\ud398\uc774\uc9c0 : <\/FONT><a href=\"http:\/\/www.seeker.kr\/\" target=\"_blank\" rel=\"noopener noreferrer\"><FONT color=#ffffff>http:\/\/www.seeker.kr\/<\/FONT><\/A><FONT color=#ffffff> <BR>*\/ <BR><BR>\/\/ \uc774\ubca4\ud2b8 \ubd80\uc5ec \ud568\uc218 <BR>function addEvent(target,e,f) { <BR>&nbsp; &nbsp; if(window.addEventListener) <BR>&nbsp; &nbsp; &nbsp; &nbsp; target.addEventListener(e,f,false); <BR>&nbsp; &nbsp; else if(window.attachEvent) <BR>&nbsp; &nbsp; &nbsp; &nbsp; target.attachEvent(&#8220;on&#8221;+e,f); <BR>&nbsp; &nbsp; else <BR>&nbsp; &nbsp; &nbsp; &nbsp; target[&#8220;on&#8221;+e] = f; <BR>} <BR><BR>function removeEvent(target,e,f) { <BR>&nbsp; &nbsp; if(window.removeEventListener) <BR>&nbsp; &nbsp; &nbsp; &nbsp; target.removeEventListener(e,f,false); <BR>&nbsp; &nbsp; else if(window.detachEvent) <BR>&nbsp; &nbsp; &nbsp; &nbsp; target.detachEvent(&#8220;on&#8221;+e,f); <BR>&nbsp; &nbsp; else <BR>&nbsp; &nbsp; &nbsp; &nbsp; target[&#8220;on&#8221;+e] = null; <BR>} <BR><BR><BR>\/\/ \uc561\uc158 \ub9ac\uc2a4\ud2b8 <BR>var _gestures = { <BR>&nbsp; &nbsp; U : [&#8220;\uc2a4\ud06c\ub864 UP&#8221;,function() {document.documentElement.scrollTop -= document.documentElement.clientHeight;}], <BR>&nbsp; &nbsp; D : [&#8220;\uc2a4\ud06c\ub864 DOWN&#8221;,function() {document.documentElement.scrollTop += document.documentElement.clientHeight;}], <BR>&nbsp; &nbsp; LU : [&#8220;\ud398\uc774\uc9c0 \uc0c1\ub2e8&#8221;,function() {document.documentElement.scrollTop = 0;}], <BR>&nbsp; &nbsp; LD : [&#8220;\ud398\uc774\uc9c0 \ud558\ub2e8&#8221;,function() {document.documentElement.scrollTop = document.documentElement.scrollHeight;}], <BR><BR>&nbsp; &nbsp; R : [&#8220;\uc55e\uc73c\ub85c&#8221;,function() {history.forward();}], <BR>&nbsp; &nbsp; L : [&#8220;\ub4a4\ub85c&#8221;,function() {history.back();}], <BR><BR>&nbsp; &nbsp; DR : [&#8220;\uc0c8 \ucc3d(\ud0ed) \uc5f4\uae30&#8221;,function() {window.open(&#8216;about:blank&#8217;);}], <BR>&nbsp; &nbsp; DL : [&#8220;\ucc3d(\ud0ed) \ub2eb\uae30&#8221;,function() {window.close();}], <BR><BR>&nbsp; &nbsp; DU : [&#8220;\ucc3d(\ud0ed) \ubcf5\uc0ac&#8221;,function() {window.open(location.href);}], <BR>&nbsp; &nbsp; UD : [&#8220;\uc0c8\ub85c \uace0\uce68&#8221;,function() {location.reload();}] <BR>} <BR><BR>\/\/ \uc0ac\uc6a9 \uc804\uc5ed\ubcc0\uc218 \uc120\uc5b8 <BR>var _g_pX,_g_pY,_g_tX,_g_tY; <BR>var _g_path = &#8220;&#8221;; <BR>var _g_target; <BR>var _g_t_dir = &#8220;&#8221;; <BR><BR>\/\/ \ub9c8\uc6b0\uc2a4 \ub2e4\uc6b4\uc2dc <BR>function _g_down(e) { <BR>&nbsp; &nbsp; var e = e || event; <BR>&nbsp; &nbsp; _g_path = &#8220;&#8221;; <BR>&nbsp; &nbsp; _g_target = e.target || e.srcElement; <BR><BR>&nbsp; &nbsp; if(e.button == 2) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; _g_pX = _g_tX = e.clientX; <BR>&nbsp; &nbsp; &nbsp; &nbsp; _g_pY = _g_tY = e.clientY; <BR>&nbsp; &nbsp; &nbsp; &nbsp; addEvent(document,&#8221;mousemove&#8221;,_g_move); <BR>&nbsp; &nbsp; &nbsp; &nbsp; addEvent(document,&#8221;mouseup&#8221;,_g_up); <BR>&nbsp; &nbsp; } else { <BR>&nbsp; &nbsp; &nbsp; &nbsp; removeEvent(document,&#8221;mousemove&#8221;,_g_move); <BR>&nbsp; &nbsp; &nbsp; &nbsp; removeEvent(document,&#8221;mouseup&#8221;,_g_up); <BR>&nbsp; &nbsp; } <BR>} <BR><BR>\/\/ \ub9c8\uc6b0\uc2a4 \uc5c5\uc2dc <BR>function _g_up(e) { <BR>&nbsp; &nbsp; if(e.button == 2) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; if(_g_path in _gestures) _gestures[_g_path][1](); <BR>&nbsp; &nbsp; &nbsp; &nbsp; removeEvent(document,&#8221;mousemove&#8221;,_g_move); <BR>&nbsp; &nbsp; &nbsp; &nbsp; removeEvent(document,&#8221;mouseup&#8221;,_g_up); <BR>&nbsp; &nbsp; } <BR>} <BR><BR>\/\/ \ucee8\ud14d\uc2a4\ud2b8 \uba54\ub274 \ubc29\uc9c0\uc6a9 \ub9ac\ud134 \ub9c9\ub294 \ud568\uc218 <BR>function _g_false(e) { <BR>&nbsp; &nbsp; if(_g_path) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; var e = e || event; <BR>&nbsp; &nbsp; &nbsp; &nbsp; if(e.preventDefault) e.preventDefault(); <BR>&nbsp; &nbsp; &nbsp; &nbsp; if(&#8220;returnValue&#8221; in e) e.returnValue = false; <BR>&nbsp; &nbsp; &nbsp; &nbsp; return false; <BR>&nbsp; &nbsp; } <BR>} <BR><BR>addEvent(document,&#8221;contextmenu&#8221;,_g_false); <BR><BR>\/\/ \ub9c8\uc6b0\uc2a4 \uc774\ub3d9\uc2dc <BR>function _g_move(e) { <BR>&nbsp; &nbsp; var e = e || event; <BR>&nbsp; &nbsp; var x = e.clientX; <BR>&nbsp; &nbsp; var y = e.clientY; <BR>&nbsp; &nbsp; var mX = x &#8211; _g_pX; <BR>&nbsp; &nbsp; var mY = _g_pY &#8211; y; <BR>&nbsp; &nbsp; var dir; <BR><BR>&nbsp; &nbsp; if(mX == 0) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; if(mY &gt; 0) dir = &#8220;U&#8221;; <BR>&nbsp; &nbsp; &nbsp; &nbsp; else if(mY &lt; 0) dir = &#8220;D&#8221;; <BR>&nbsp; &nbsp; &nbsp; &nbsp; else return; <BR>&nbsp; &nbsp; } else { <BR>&nbsp; &nbsp; &nbsp; &nbsp; var slope = mY\/mX; <BR>&nbsp; &nbsp; &nbsp; &nbsp; if(slope &gt; 2 || slope &lt; -2) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(mY &gt; 0) dir = &#8220;U&#8221;; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else dir = &#8220;D&#8221;; <BR>&nbsp; &nbsp; &nbsp; &nbsp; } else if(slope &lt; 0.5 &amp;&amp; slope &gt; -0.5) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(mX &gt; 0) dir = &#8220;R&#8221;; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else dir = &#8220;L&#8221;; <BR>&nbsp; &nbsp; &nbsp; &nbsp; } <BR>&nbsp; &nbsp; } <BR><BR>&nbsp; &nbsp; if(dir &amp;&amp; dir != _g_path.charAt(_g_path.length-1)) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; if(_g_t_dir != dir) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _g_tX = _g_pX; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _g_tY = _g_pY; <BR>&nbsp; &nbsp; &nbsp; &nbsp; } <BR>&nbsp; &nbsp; &nbsp; &nbsp; if(Math.abs(x-_g_tX) &gt; 20 || Math.abs(_g_tY-y) &gt; 20) { <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _g_path += dir; <BR>&nbsp; &nbsp; &nbsp; &nbsp; } <BR>&nbsp; &nbsp; } <BR>&nbsp; &nbsp; _g_t_dir = dir; <BR>&nbsp; &nbsp; _g_pX = x; <BR>&nbsp; &nbsp; _g_pY = y; <BR><BR>&nbsp; &nbsp; window.status = _g_path + ((_g_path in _gestures)?(&#8221; : &#8221; + _gestures[_g_path][0]):&#8221;&#8221;); <BR>} <BR><BR>addEvent(document,&#8221;mousedown&#8221;,_g_down);<\/FONT> <\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[\uc2a4\ud06c\ub9bd\ud2b8] [JS] Mouse Gesture \uae00\uc4f4\uc774 &nbsp; Seeker \ub0a0 \uc9dc 08-10-30 21:25 \uc870 \ud68c 823 Link1 &nbsp; http:\/\/www.seeker.kr\/test\/mouse_gesture.html (258) \ub9c8\uc6b0\uc2a4 \uc81c\uc2a4\ucc98, \uc989 \ub9c8\uc6b0\uc2a4\uc758 \uc774\ub3d9\uc73c\ub85c \uc9c0\uc815\ud55c \ub3d9\uc791\uc744 \uc2e4\ud589\ud558\ub294 \uae30\ub2a5\uc785\ub2c8\ub2e4. FF\ub294 \uc774 \uae30\ub2a5\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ubd80\uac00\uae30\ub2a5\uc774 \uba87\uac1c \uc788\uace0, \uc544\uc608 \uc81c\uc2a4\ucc98 \uae30\ub2a5\uc774 \uae30\ubcf8\uc73c\ub85c \ub0b4\uc7a5\ub41c \ube0c\ub77c\uc6b0\uc800\ub3c4 \uc788\uc9c0\ub9cc IE\ub294 \uc804\ud600 \uc0c1\uad00\uc5c6\uae30 \ub54c\ubb38\uc5d0&#8230; \ub2e8\ucd95\ud0a4 \uae30\ub2a5\uc744 \ub9cc\ub4e4\uace0 \ub09c \ub4a4 \ubb38\ub4dd \uc774\uac83\ub3c4 \uc788\uc73c\uba74 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[368,369,155],"class_list":["post-2459","post","type-post","status-publish","format-standard","hentry","category-papa-php","tag-js","tag-369","tag-155"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/2459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2459"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/2459\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}