|
자바스크립트를 이용한 메뉴입니다.(스크립트상 문제 없습니다.)
이미지가 없어서 엑박이 떠도 마우스 오버했을때 하위메뉴가 1번에서 5번쪽으로 갈수록 조금씩 벌어지는게 보일거에요.
이거 해결 할 수 있을까요??
도대체 왜 상위메뉴와 하위메뉴가 5번으로 갈수록 벌어지는지 모르겠네요.
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=euc-kr" />
<title>Untitled
doc-ument</title>
<script
type="text/xxJavaScript">
<!--
function MM_swapImgRestore() {
//v3.0
var i,x,a=doc-ument.MM_sr;
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=doc-ument; if(d.images){
if(!d.MM_p) d.MM_p=new Array();
var
i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d)
d=doc-ument; if((p=n.indexOf("?"))>0&&parent.frames.length)
{
d=parent.frames[n.substring(p+1)].doc-ument;
n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for
(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].doc-ument);
if(!x &&
d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var
i,j=0,x,a=MM_swapImage.arguments; doc-ument.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if
((x=MM_findObj(a[i]))!=null){doc-ument.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src;
x.src=a[i+2];}
}
//-->
</script>
</head>
<body
on-load="MM_preloadImages('img/menu01_over.gif','img/menu02_over.gif','img/menu03_over.gif','img/menu04_over.gif','img/menu05_over.gif','img/01_s_menu01_over.gif','img/02_s_menu02_over.gif','img/02_s_menu03_over.gif','img/02_s_menu04_over.gif','img/05_s_menu01_over.gif')">
<script
language='xxjavascript'>
function menu_event(menu_id,
menu_state){
if(menu_state == "show"){
for(i
= 1; i <= 5; i++){
temp_id = "menu" +
i;
doc-ument.all[temp_id].style.display =
"none";
}
doc-ument.all[menu_id].style.display
= "block";
}else if(menu_state ==
"hidden"){
doc-ument.all[menu_id].style.display =
"none";
}
}
</script>
<table width="600"
border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="135"
on-MouseOver="menu_event('menu1','show');"><a href="#"
on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('top_tab01','','img/menu01_over.gif',1)"><img
src="img/menu01.gif" name="top_tab01" width="135" height="29" border="0"
id="top_tab01"
/></a></td>
<td
width="10"> </td>
<td width="79" on-MouseOver="menu_event('menu2','show');"><a href="#"
on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('top_tab02','','img/menu02_over.gif',1)"><img
src="img/menu02.gif" name="top_tab02" width="79" height="29" border="0"
id="top_tab02"
/></a></td>
<td
width="10"> </td>
<td width="65" on-MouseOver="menu_event('menu3','show');"><a href="#"
on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('top_tab03','','img/menu03_over.gif',1)"><img
src="img/menu03.gif" name="top_tab03" width="65" height="29" border="0"
id="top_tab03"
/></a></td>
<td
width="10"> </td>
<td width="138" on-MouseOver="menu_event('menu4','show');"><a href="#"
on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('top_tab04','','img/menu04_over.gif',1)"><img
src="img/menu04.gif" name="top_tab04" width="138" height="29" border="0"
id="top_tab04"
/></a></td>
<td
width="10"> </td>
<td width="109" on-MouseOver="menu_event('menu5','show');"><a href="#"
on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('top_tab05','','img/menu05_over.gif',1)"><img
src="img/menu05.gif" name="top_tab05" width="109" height="29" border="0"
id="top_tab05"
/></a></td>
</tr>
</table></td>
</tr>
<tr>
<td><table
width="600" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr style="display:none" id="menu1" on-MouseOver="menu_event('menu1','show');"
on-MouseOut="menu_event('menu1','hidden')">
<td
width="35"> </td>
<td width="52"><a href="#" on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('sub_tab01','','img/01_s_menu01_over.gif',1)"><img
src="img/01_s_menu01.gif" name="sub_tab01" width="52" height="22" border="0"
id="sub_tab01"
/></a></td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table
width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr style="display:none" id="menu2" on-MouseOver="menu_event('menu2','show');"
on-MouseOut="menu_event('menu2','hidden')">
<td
width="170"> </td>
<td width="36"><a href="#" on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('sub_tab02','','img/02_s_menu02_over.gif',1)"><img
src="img/02_s_menu02.gif" name="sub_tab02" width="36" height="22" border="0"
id="sub_tab02"
/></a></td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table
width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr style="display:none" id="menu3" on-MouseOver="menu_event('menu3','show');"
on-MouseOut="menu_event('menu3','hidden')">
<td
width="240"> </td>
<td width="50"><a href="#" on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('sub_tab03','','img/02_s_menu03_over.gif',1)"><img
src="img/02_s_menu03.gif" name="sub_tab03" width="50" height="22" border="0"
id="sub_tab03"
/></a></td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table
width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr style="display:none" id="menu4" on-MouseOver="menu_event('menu4','show');"
on-MouseOut="menu_event('menu4','hidden')">
<td> </td>
<td width="51"><a href="#" on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('sub_tab04','','img/02_s_menu04_over.gif',1)"><img
src="img/02_s_menu04.gif" name="sub_tab04" width="51" height="22" border="0"
id="sub_tab04"
/></a></td>
<td
width="200"> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table
width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr style="display:none" id="menu5" on-MouseOver="menu_event('menu5','show');"
on-MouseOut="menu_event('menu5','hidden')">
<td> </td>
<td width="118"><a href="#" on-mouseout="MM_swapImgRestore()"
on-mouseover="MM_swapImage('sub_tab05','','img/05_s_menu01_over.gif',1)"><img
src="img/05_s_menu01.gif" name="sub_tab05" width="118" height="22" border="0"
id="sub_tab05"
/></a></td>
<td
width="30"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>