var obj_x,obj_y,obj_width,obj_height;
var flag=false;
var obj;
function table_resize_start(e,target_id){
flag=true;
obj=document.getElementById(target_id);
if(document.all){
obj_x=e.clientX;
obj_y=e.clientY;
obj_width = obj.style.pixelWidth;
obj_height = obj.style.pixelHeight;
}else if(document.getElementById){
obj_x=e.pageX;
obj_y=e.pageY;
obj_width = parseInt((obj.style.width).replace("px",""),10);
obj_height = parseInt((obj.style.height).replace("px",""),10);
}
obj.style.cursor= "n-resize";
}
function table_resize(e){
if(flag){
if(document.all){
obj_xx=e.clientX-obj_x
obj_yy=e.clientY-obj_y
obj.style.pixelWidth=obj_width + obj_xx;
obj.style.pixelHeight=obj_height +obj_yy;
}
else if(document.getElementById){
obj_xx=e.pageX-obj_x
obj_yy=e.pageY-obj_y
objWidth = obj_width+obj_xx;
objHeight = obj_height+obj_yy;
obj.style.width=objWidth+"px"
obj.style.height=objHeight+"px"
}
}
}
function table_resize_end(){
flag=false;
obj.style.cursor= "";
}
var flag=false;
var obj;
function table_resize_start(e,target_id){
flag=true;
obj=document.getElementById(target_id);
if(document.all){
obj_x=e.clientX;
obj_y=e.clientY;
obj_width = obj.style.pixelWidth;
obj_height = obj.style.pixelHeight;
}else if(document.getElementById){
obj_x=e.pageX;
obj_y=e.pageY;
obj_width = parseInt((obj.style.width).replace("px",""),10);
obj_height = parseInt((obj.style.height).replace("px",""),10);
}
obj.style.cursor= "n-resize";
}
function table_resize(e){
if(flag){
if(document.all){
obj_xx=e.clientX-obj_x
obj_yy=e.clientY-obj_y
obj.style.pixelWidth=obj_width + obj_xx;
obj.style.pixelHeight=obj_height +obj_yy;
}
else if(document.getElementById){
obj_xx=e.pageX-obj_x
obj_yy=e.pageY-obj_y
objWidth = obj_width+obj_xx;
objHeight = obj_height+obj_yy;
obj.style.width=objWidth+"px"
obj.style.height=objHeight+"px"
}
}
}
function table_resize_end(){
flag=false;
obj.style.cursor= "";
}
'개인적인 프로그램 > 자바스크립트' 카테고리의 다른 글
동적인 탑화면 (0) | 2011.12.12 |
---|---|
javascript 오류와 캐릭터셋 (0) | 2011.10.26 |
ajax 와 xml 그리고 ie, ff (0) | 2011.10.26 |
ajax와 response.setContentType("text/xml;charset=utf-8") (0) | 2011.10.26 |
select 에서 순서 재정렬 하기 (0) | 2011.10.26 |