홈페이지에 단축키를 사용하자

<script language=”JavaScript”>

// 핫키 함수.

function movePage(){
var EventStatus = event.srcElement.tagName;

var homepage = “http://주소”;

if(EventStatus!=’INPUT’&&EventStatus!=’TEXTAREA’) {

// Main Page로 이동. 키값 [H,h]
if (event.keyCode==’72’) location.href=homepage;
if (event.keyCode==’104′) location.href=homepage;

// 자유게시판으로 이동. 키값 [F,f]
if (event.keyCode==’70’) location.href=homepage + “/zboard/zboard.php?id=1”;
if (event.keyCode==’102′) location.href=homepage + “/zboard/zboard.php?id=1”;

// 유머게시판으로 이동. 키값 [U,u]
if (event.keyCode==’85’) location.href=homepage + “/zboard/zboard.php?id=2”;
if (event.keyCode==’117′) location.href=homepage + “/zboard/zboard.php?id=2”

// 일반/IT 뉴스게시판으로 이동. 키값 [N,n]
if (event.keyCode==’78’) location.href=homepage + “/zboard/zboard.php?id=3”;
if (event.keyCode==’110′) location.href=homepage + “/zboard/zboard.php?id=3”;

// 연예/스포츠 뉴스게시판으로 이동. 키값 [M,m]
if (event.keyCode==’77’) location.href=homepage + “/zboard/zboard.php?id=4”;
if (event.keyCode==’109′) location.href=homepage + “/zboard/zboard.php?id=4”;

// 자료창고게시판으로 이동. 키값 [P,p]
if (event.keyCode==’80’) location.href=homepage + “/zboard/zboard.php?id=5”;
if (event.keyCode==’112′) location.href=homepage + “/zboard/zboard.php?id=5”;

// 사진모음게시판으로 이동. 키값 [A,a]
if (event.keyCode==’65’) location.href=homepage + “/zboard/zboard.php?id=6”;
if (event.keyCode==’97’) location.href=homepage + “/zboard/zboard.php?id=6”;

// 작품게시판으로 이동. 키값 [J,j]
if (event.keyCode==’74’) location.href=homepage + “/zboard/zboard.php?id=7”;
if (event.keyCode==’106′) location.href=homepage + “/zboard/zboard.php?id=7″;
}
}
document.onkeypress=movePage;
</script>

// 키값 알아내는 스크립트
<SCRIPT LANGUAGE=”Javascript”>
<!–
function keyCodeprint() {
var keyCode = window.event.keyCode
window.status = keyCode
}
document.onkeydown = keyCodeprint
//–>
</SCRIPT>

키값

a = 97 / b= 98 / c= 99 / d= 100 / e= 101 / f= 102 / g = 103 / h = 104 / i = 105 / j = 106
k = 107 / l = 108 / m = 109 / n = 110 / o = 111 / p = 112 / q = 113 / r = 114 / s = 115
t = 116 / u = 117 / v = 118 / w = 119 / x= 120 / y= 121 / z= 122

A = 65 / B = 66 / C = 67  /D = 68 / E = 69 / F = 70 / G = 71 / H = 72 / I = 73  /J = 74
K = 75 / L = 76 / M = 77 / N = 78 / O = 79 / P = 80 / Q = 81 / R = 82 / S = 83 / T = 84
U = 85 / V = 86 / W = 87 / X = 88 / Y = 89 / Z = 90

You may also like...

댓글 남기기