내가 만든 구질구질한 넘버패드 스크립트 ㅎㅎ
function ShowNumPad2(p_strTargetName) {
var objTarget = document.getElementById(p_strTargetName);
var TargetTop = objTarget.offsetTop;
var TargetLeft = objTarget.offsetLeft + objTarget.offsetWidth;
var arrNumString = new Array("7", "8", "9", "4", "5", "6", "1", "2",
"3", "←", "0", "C");
if (document.getElementById("NUMPAD") != null) {
var Target = document.getElementById("NUMPAD");
document.body.removeChild(Target);
}
var NUMPAD_frame = document.createElement("div");
NUMPAD_frame.id = "NUMPAD";
NUMPAD_frame.style.width = "195px";
NUMPAD_frame.style.height = "290px";
NUMPAD_frame.style.backgroundColor = "#FFFFFF";
NUMPAD_frame.style.border = "solid 1px black";
NUMPAD_frame.style.display = "block";
NUMPAD_frame.style.position = "absolute";
NUMPAD_frame.style.top = TargetTop + "px";
NUMPAD_frame.style.left = TargetLeft + "px";
var strInnerHTML = "<table><tr><td colspan='3'
style='text-align:right;'>";
strInnerHTML = strInnerHTML + "<input type='button' value='X'
style='width:60px;height:25px;color:white;background-color:#cc6699;'
onclick=HideNumPad()>";
strInnerHTML = strInnerHTML + "</td></tr>";
var nNum = 0;
for (i = 0; i < 4; i++) {
strInnerHTML = strInnerHTML + "<tr>";
for (j = 0; j < 3; j++) {
strInnerHTML = strInnerHTML + "<td>";
strInnerHTML = strInnerHTML + "<input type='button' value='"
+ arrNumString[nNum] + "'
style='width:60px;height:60px;font-size:30px;color:white;background-color:#6699cc;'"
strInnerHTML = strInnerHTML + " onclick=PadClick('" +
p_strTargetName + "')>";
strInnerHTML = strInnerHTML + "</td>";
nNum++;
}
strInnerHTML = strInnerHTML + "</tr>";
}
strInnerHTML = strInnerHTML + "</table>";
NUMPAD_frame.innerHTML = strInnerHTML;
document.body.appendChild(NUMPAD_frame);
}