°¡ÃâÇÏ´Â ¼Ò³â | ||
¤ýÀÛ¼ºÀÏ: 2014-04-18 (±Ý) 22:27 | ||
¤ýµ¿¿µ»óÁÖ¼Ò : |
<script type="text/javascript">// (function(){ var cancel=function(e){ if (window.event) { window.event.cancelBubble = true; window.event.returnValue = false; } if (e && e.stopPropagation && e.preventDefault) { e.stopPropagation(); e.preventDefault(); } return false; }; var block=function(e){ e = e || window.event; var t=e.srcElement || e.target; var tag=t.tagName; if (e && tag==='HTML' || tag==='INPUT' || tag==='TEXTAREA' || tag==='BUTTON' || tag==='SELECT' || tag==='OPTION' || tag==='EMBED' || tag==='OBJECT') { return; } if (e.type==='keydown' || e.type=='keyup') { // keyboard event : only block ctrl-A, ctrl-a, ctrl-C, ctrl-c, meta-A, meta-a, meta-C, meta-c if ((e.ctrlKey || e.metaKey) && (e.keyCode == 65 || e.keyCode == 97 || e.keyCode == 67 || e.keyCode == 99)) { return cancel(e); } } else if(e.type == "contextmenu"){ alert('.'); return cancel(e); } else { return cancel(e); } } var addEvent = function(el, type, fn){ if (window.addEventListener) { el.addEventListener(type, fn, false); } else if (window.attachEvent) { el.attachEvent('on' + type, fn); } else { el['on' + type] = fn; } } var addBlockEvent = function(){ addEvent(document.body,'keydown',block); addEvent(document.body,'keyup',block); addEvent(document.body,'mouseup',block); addEvent(document.body,'mousedown',block); addEvent(document.body,'dragstart',block); addEvent(document.body,'selectstart',block); addEvent(document.body,'copy',block); addEvent(document.body,'contextmenu', block); } addEvent(window,'load',addBlockEvent); })(); //]]> </script> µ¿¿µ»ó ¼³¸íÀº ¾ÈÀú°Åµµ µÊ ³»¿ë : µ¿¿µ»ó ´ëÃæ¼³¸íÇϱ⠳»¿ë: ±âŸµ¢µ¢ ±âŸ : |