함수 JObj(){}
JObj.$c = function(tag){return document.createElement(tag)};
JObj.$ = function(id){return document.getElementById(id)};
JObj.isRate = function(pRateString){
if(!isNaN(pRateString)) return false;
if(pRateString.substr(pRateString.length-1,1) != "%")
false를 반환;
if(isNaN(pRateString.substring(0,pRateString.length - 1)))
return false;
true를 반환합니다.
}
함수 JPos(){}
JPos.getAbsPos = function(pTarget){
var x_ = y_ = 0;
while(pTarget.offsetParent){
x_ = pTarget.offsetLeft;
y_ = pTarget.offsetTop;
pTarget = pTarget.offsetParent;
}
x_ = pTarget.offsetLeft;
y_ = pTarget.offsetTop;
return {x:x_,y:y_};
}
JPos.getMousePos = function(evt){
var x_ = y_ = 0;
이벤트 = 이벤트 || 창.이벤트;
if(evt.pageX || evt.pageY){
x_ = evt.pageX;
y_ = evt.pageY;
}else{
x_ = evt.clientX document.body.scrollLeft - document.body.clientLeft;
y_ = evt.clientY document.body.scrollTop - document.body.clientTop;
}
return {x:x_,y:y_};
}