묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
제로보드 작성자 클릭하면 메뉴뜨는거 같은거 구현하는거 말인데요 문제가..
2005.12.04 16:06
제로보드에서 글쓴사람 이름 누르면 메뉴창 쪼끄마게 뜨는거 하려고 하는데 안되네요 음...
offsetWidth 는 null 이거나 개체가 아니라는 에러가 뜹니다
<html>
<head>
<title>.com</title>
<meta http-equiv='Content-Type' content='text/html; charset=ks_c_5601-1987'>
<script language='javascript'>
var select_obj;
function List(date,status) {
var obj=document.all[date];
var _tmpx,_tmpy, marginx, marginy;
_tmpx = event.clientX + parseInt(obj.offsetWidth);
_tmpy = event.clientY + parseInt(obj.offsetHeight);
_marginx = document.body.clientWidth - _tmpx;
_marginy = document.body.clientHeight - _tmpy ;
if(_marginx < 0)
_tmpx = event.clientX + document.body.scrollLeft + _marginx ;
else
_tmpx = event.clientX + document.body.scrollLeft ;
if(_marginy < 0)
_tmpy = event.clientY + document.body.scrollTop + _marginy +20;
else
_tmpy = event.clientY + document.body.scrollTop ;
obj.style.posLeft=_tmpx-13;
obj.style.posTop=_tmpy-12;
if(status=='visible') {
if(select_obj) {
select_obj.style.visibility='+ '+ 'hidden';
select_obj=null;
}
select_obj=obj;
}else{
select_obj=null;
}
obj.style.visibility=status;
}
function print_List(date,num) {
var printHeight = 0;
var printMain="";
if(date&&num) {
var c_num=parseint(num);
for(i=1; i<=c_num; i++) {
if(c_num.length == 1) {
var tag_num="00"+i;
}
if(c_num.length == 2) {
var tag_num="0"+i;
}
printMain = printMain + "<tr onMousedown=location.href='/?date="+date+tag_num+"','','width=1,height=1,left=1,top=1';><td nowrap> "+tag_num+" </td></tr>";
printHeight = printHeight + 16;
}
}
var printHeader = "<div id='"+date+"' style='position:absolute; left:10px; top:25px; width:127; height: "+printHeight+"; z-index:1; visibility: hidden' onMousedown=List('"+date+"','hidden')><table border=0><tr><td colspan=3 onMouseover=List('"+date+"','hidden') height=3></td></tr><tr><td width=5 onMouseover=List('"+date+"','hidden') rowspan=2> </td><td height=5></td></tr><tr><td><table style=cursor:hand border='0' cellspacing='1' cellpadding='0' bgcolor='black' width=100% height=100%><tr><td valign=top bgcolor=white><table border=0 cellspacing=0 cellpadding=3 width=100% height=100%>";
var printFooter = "</table></td></tr></table></td><td width=5 rowspan=2 onMouseover=List('"+date+"','hidden')> </td></tr><tr><td colspan=3 height=10 onMouseover=List('+ '"+date+"','hidden')></td></tr></table></div>";
document.writeln(printHeader+printMain+printFooter);
}
</script>
</head>
<body>
-- 중간 생략 --
<td align='center'>
<span onMousedown="print_List('20050808', '002');" onClick="List('20050808','visible');" style='color:red; text-decoration:none; font-weight:bold; cursor:hand'>8</span>
</td>
-- 뒤 생략 --
</body>
</html>
offsetWidth 는 null 이거나 개체가 아니라는 에러가 뜹니다
<html>
<head>
<title>.com</title>
<meta http-equiv='Content-Type' content='text/html; charset=ks_c_5601-1987'>
<script language='javascript'>
var select_obj;
function List(date,status) {
var obj=document.all[date];
var _tmpx,_tmpy, marginx, marginy;
_tmpx = event.clientX + parseInt(obj.offsetWidth);
_tmpy = event.clientY + parseInt(obj.offsetHeight);
_marginx = document.body.clientWidth - _tmpx;
_marginy = document.body.clientHeight - _tmpy ;
if(_marginx < 0)
_tmpx = event.clientX + document.body.scrollLeft + _marginx ;
else
_tmpx = event.clientX + document.body.scrollLeft ;
if(_marginy < 0)
_tmpy = event.clientY + document.body.scrollTop + _marginy +20;
else
_tmpy = event.clientY + document.body.scrollTop ;
obj.style.posLeft=_tmpx-13;
obj.style.posTop=_tmpy-12;
if(status=='visible') {
if(select_obj) {
select_obj.style.visibility='+ '+ 'hidden';
select_obj=null;
}
select_obj=obj;
}else{
select_obj=null;
}
obj.style.visibility=status;
}
function print_List(date,num) {
var printHeight = 0;
var printMain="";
if(date&&num) {
var c_num=parseint(num);
for(i=1; i<=c_num; i++) {
if(c_num.length == 1) {
var tag_num="00"+i;
}
if(c_num.length == 2) {
var tag_num="0"+i;
}
printMain = printMain + "<tr onMousedown=location.href='/?date="+date+tag_num+"','','width=1,height=1,left=1,top=1';><td nowrap> "+tag_num+" </td></tr>";
printHeight = printHeight + 16;
}
}
var printHeader = "<div id='"+date+"' style='position:absolute; left:10px; top:25px; width:127; height: "+printHeight+"; z-index:1; visibility: hidden' onMousedown=List('"+date+"','hidden')><table border=0><tr><td colspan=3 onMouseover=List('"+date+"','hidden') height=3></td></tr><tr><td width=5 onMouseover=List('"+date+"','hidden') rowspan=2> </td><td height=5></td></tr><tr><td><table style=cursor:hand border='0' cellspacing='1' cellpadding='0' bgcolor='black' width=100% height=100%><tr><td valign=top bgcolor=white><table border=0 cellspacing=0 cellpadding=3 width=100% height=100%>";
var printFooter = "</table></td></tr></table></td><td width=5 rowspan=2 onMouseover=List('"+date+"','hidden')> </td></tr><tr><td colspan=3 height=10 onMouseover=List('+ '"+date+"','hidden')></td></tr></table></div>";
document.writeln(printHeader+printMain+printFooter);
}
</script>
</head>
<body>
-- 중간 생략 --
<td align='center'>
<span onMousedown="print_List('20050808', '002');" onClick="List('20050808','visible');" style='color:red; text-decoration:none; font-weight:bold; cursor:hand'>8</span>
</td>
-- 뒤 생략 --
</body>
</html>