This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| html, body { margin: 0; padding: 0;} | |
| #leftBar { | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| bottom: 0; | |
| color: red; | |
| opacity: .50; | |
| background-color: #000; | |
| width: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> | |
| <meta charset=utf-8 /> | |
| <title>JS Bin</title> | |
| <style> | |
| dl {} | |
| dd { margin: 0; padding: 0.5em 0; padding-left: 10px; } | |
| dt { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function(){ | |
| $('#window-btn').click(function(){ | |
| if ( $.browser.msie ) { | |
| window.opener='Self'; | |
| window.open('','_parent',''); | |
| window.close(); | |
| } else { | |
| window.close(); // 일반적인 현재 창 닫기 | |
| window.open('about:blank','_self').self.close(); // IE에서 묻지 않고 창 닫기 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.fn.exist = function(){ | |
| return this.length > 0; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. | |
| var lines = [ | |
| '<!DOCTYPE html>', | |
| '<html>', | |
| '<body>', | |
| '<h1>Hello, world!</h1>', | |
| '</body>', | |
| '</html>' | |
| ].join('\n'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !function mouseKeyboardBlock() { | |
| document.oncontextmenu = new Function('return false'); | |
| document.onselectstart = new Function('return false'); | |
| document.ondragstart = new Function('return false'); | |
| document.ondragenter = new Function('return false'); | |
| document.ondragover = new Function('return false'); | |
| document.ondrop = new Function('return false'); | |
| document.onkeydown = new Function('return false'); | |
| }(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| onkeydown - 모든 키를 눌렀을때(shift, alt, control, capslock 등의 키도 모두 인식한다. 단 한영변환,한자 등의 특수키는 인식못함.) | |
| onkeyup - 모든 키를 눌렀다 땠을때(onkeydown 에서 인식하는 키들을 인식) | |
| onkeypress - 실제로 글자가 써질때 (shift, enter 같은 키는 인식하지 못한다) | |
| */ | |
| document.getElementById('id').onkeyup=function(e){ | |
| var event = e || window.event; | |
| console.log('event '+ event); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setTimeout(); // 일정 시간 후에 함수를 한 번 실행 | |
| setInterval(); // 일정 시간마다 함수를 반복 실행 | |
| clearTimeout(); // 일정 시간 후에 함수를 한 번 실행하는 것을 중지 | |
| clearInterval(); // 일정 시간마다 함수를 반복하는 것을 중지 | |
| /* | |
| Eaxmple | |
| **/ | |
| window.onload = function(){ | |
| // 윈도우가 로드될 때 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var points = [40,100,1,5,25,10]; | |
| points.sort(function(a,b){return a-b}); | |
| console.log(points); // 1,5,10,25,40,100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| document.execCommand("BackgroundImageCache", false, true); | |
| } catch(err) {} |