묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
마우스 오버시 레이어보이기가 안됩니다...(소스 있어요,)
2006.05.26 12:15
http://semicode.skynet.co.kr수정되야할 부분으로 보이는 곳에 표시해놨습니다.. 부탁드려요
// 자바스크립트 부분
<script language="JavaScript">
<!--
function na_restore_img_src(name, nsdoc)
{
var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'+ '+ '.'+name : 'document.all.'+name);
if (name == '')
return;
if (img && img.altsrc) {
img.src = img.altsrc;
img.altsrc = null;
}
}
function na_preload_img()
{
var img_list = na_preload_img.arguments;
if (document.preloadlist == null)
document.preloadlist = new Array();
var top = document.preloadlist.length;
for (var i=0; i < img_list.length; i++) {
document.preloadlist[top+i] = new Image;
document.preloadlist[top+i].src = img_list[i+1];
}
}
function na_change_img_src(name, nsdoc, rpath, preload)
{
var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
if (name == '')
return;
if (img) {
img.altsrc = img.src;
img.src = rpath;
}
}
// -->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" OnLoad="na_preload_img(false, 'images/main_031.gif', 'images/main_041.gif', 'images/main_051.gif', 'images/main_061.gif', 'images/main_071.gif');">
<table id="Table_01" width="1024" height="768" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5" width="900" background="main_logo.gif">
<a href="http://semicode.skynet.co.kr"><img src="images/logo.gif" width="410" height="70" border="0"><img src="images/main_logo.gif" width="490" height="70" border="0"></a></td>
<td rowspan="4" width="150" background="images/main_02.gif">
<img src="images/main_02.gif" width="124" height="768"></td>
</tr>
<tr>
<td width="395">
<a href="whoami.html" target="main" OnMouseOut="na_restore_img_src('image1', 'document')" OnMouseOver="na_change_img_src('image1', 'document', 'images/main_031.gif', true);" ><img src="images/main_03.gif" width="395" height="30" border="0" name="image1"></a></td>
<td width="120">
<a href="diary.html" target="main" OnMouseOut="na_restore_img_src('image2', 'document')" OnMouseOver="na_change_img_src('image2', 'document', '+ 'images/main_041.gif', true);" ><img src="images/main_04.gif" width="120" height="30" border="0" name="image2"></a></td>
// 서브메뉴 보이게 노력중인부분
<td width="120">
<a OnMouseOver="na_show_layer(" layer1");onMouseOut='na_hide_layer("layer1");" href="interior.html" target="main" OnMouseOut="na_restore_img_src(' image3', 'document')" OnMouseOver="na_change_img_src('image3', 'document', 'images/main_051.gif', true);" ><img src="images/main_05.gif" width="120" height="30" border="0" name="image3"></a></td>
<td width="120">
<a href="port.html" target="main" OnMouseOut="na_restore_img_src('image4', '+ 'document')" OnMouseOver="na_change_img_src('image4', 'document', 'images/main_061.gif', true);" ><img src="images/main_06.gif" width="120" height="30" border="0" name="image4"></a></td>
<td width="119">
<a href="com.html" target="main" OnMouseOut="na_restore_img_src('image5', 'document')" OnMouseOver="na_change_img_src('image5', 'document', 'images/main_071.gif', true);" ><img src="images/main_07.gif" width="145" height="30" border="0" name="image5"></a></td>
</tr>
<tr>
<td colspan="5" width="900" background="images/main_08.gif">
<table border="0" width="900" height="578" cellpadding="0" cellspacing="0">
<tr>
<td><iframe src="home.html" width=900 height=578 frameborder=0 allowTransparency=true marginwidth=0 marginheight=0 scrolling=auto name=main>
</iframe>
// 서브레이어
<div id="layer1" style="width:120px; height:119px; position:absolute; left:516px; top:100px; z-index:1;">
<p><img src="images/3sub1.gif" width="120" height="24" border="0"><img src="images/3sub2.gif" width="120" height="21" border="0"><img src="images/3sub3.gif" width="120" height="20" border="0"><img src="images/3sub4.gif" width="120" height="20" border="0"><img src="images/3sub5.gif" width="120" height="34" border="0"></p>
</div>
<p> </p>
</td>
</tr>
</table>
<img src="images/main_09.gif" width="900" height="90" border="0">
</td>
</tr>
<tr>
<td colspan="5" width="874">
</td>
</tr>
</table>
</body>
</html>
위에 소스로 올려놨는데..
메뉴중에 마우스 오버시 이미지를 바꾸는 롤오버하고 레이어를 보이게해서 서브메뉴를 넣을려고 하거든요..
마우스를 때면 사라지게하는 것으로 연구중인데... 잘안되네요.. 수정할 부분좀 알려주세요.
// 자바스크립트 부분
<script language="JavaScript">
<!--
function na_restore_img_src(name, nsdoc)
{
var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'+ '+ '.'+name : 'document.all.'+name);
if (name == '')
return;
if (img && img.altsrc) {
img.src = img.altsrc;
img.altsrc = null;
}
}
function na_preload_img()
{
var img_list = na_preload_img.arguments;
if (document.preloadlist == null)
document.preloadlist = new Array();
var top = document.preloadlist.length;
for (var i=0; i < img_list.length; i++) {
document.preloadlist[top+i] = new Image;
document.preloadlist[top+i].src = img_list[i+1];
}
}
function na_change_img_src(name, nsdoc, rpath, preload)
{
var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
if (name == '')
return;
if (img) {
img.altsrc = img.src;
img.src = rpath;
}
}
// -->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" OnLoad="na_preload_img(false, 'images/main_031.gif', 'images/main_041.gif', 'images/main_051.gif', 'images/main_061.gif', 'images/main_071.gif');">
<table id="Table_01" width="1024" height="768" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="5" width="900" background="main_logo.gif">
<a href="http://semicode.skynet.co.kr"><img src="images/logo.gif" width="410" height="70" border="0"><img src="images/main_logo.gif" width="490" height="70" border="0"></a></td>
<td rowspan="4" width="150" background="images/main_02.gif">
<img src="images/main_02.gif" width="124" height="768"></td>
</tr>
<tr>
<td width="395">
<a href="whoami.html" target="main" OnMouseOut="na_restore_img_src('image1', 'document')" OnMouseOver="na_change_img_src('image1', 'document', 'images/main_031.gif', true);" ><img src="images/main_03.gif" width="395" height="30" border="0" name="image1"></a></td>
<td width="120">
<a href="diary.html" target="main" OnMouseOut="na_restore_img_src('image2', 'document')" OnMouseOver="na_change_img_src('image2', 'document', '+ 'images/main_041.gif', true);" ><img src="images/main_04.gif" width="120" height="30" border="0" name="image2"></a></td>
// 서브메뉴 보이게 노력중인부분
<td width="120">
<a OnMouseOver="na_show_layer(" layer1");onMouseOut='na_hide_layer("layer1");" href="interior.html" target="main" OnMouseOut="na_restore_img_src(' image3', 'document')" OnMouseOver="na_change_img_src('image3', 'document', 'images/main_051.gif', true);" ><img src="images/main_05.gif" width="120" height="30" border="0" name="image3"></a></td>
<td width="120">
<a href="port.html" target="main" OnMouseOut="na_restore_img_src('image4', '+ 'document')" OnMouseOver="na_change_img_src('image4', 'document', 'images/main_061.gif', true);" ><img src="images/main_06.gif" width="120" height="30" border="0" name="image4"></a></td>
<td width="119">
<a href="com.html" target="main" OnMouseOut="na_restore_img_src('image5', 'document')" OnMouseOver="na_change_img_src('image5', 'document', 'images/main_071.gif', true);" ><img src="images/main_07.gif" width="145" height="30" border="0" name="image5"></a></td>
</tr>
<tr>
<td colspan="5" width="900" background="images/main_08.gif">
<table border="0" width="900" height="578" cellpadding="0" cellspacing="0">
<tr>
<td><iframe src="home.html" width=900 height=578 frameborder=0 allowTransparency=true marginwidth=0 marginheight=0 scrolling=auto name=main>
</iframe>
// 서브레이어
<div id="layer1" style="width:120px; height:119px; position:absolute; left:516px; top:100px; z-index:1;">
<p><img src="images/3sub1.gif" width="120" height="24" border="0"><img src="images/3sub2.gif" width="120" height="21" border="0"><img src="images/3sub3.gif" width="120" height="20" border="0"><img src="images/3sub4.gif" width="120" height="20" border="0"><img src="images/3sub5.gif" width="120" height="34" border="0"></p>
</div>
<p> </p>
</td>
</tr>
</table>
<img src="images/main_09.gif" width="900" height="90" border="0">
</td>
</tr>
<tr>
<td colspan="5" width="874">
</td>
</tr>
</table>
</body>
</html>
위에 소스로 올려놨는데..
메뉴중에 마우스 오버시 이미지를 바꾸는 롤오버하고 레이어를 보이게해서 서브메뉴를 넣을려고 하거든요..
마우스를 때면 사라지게하는 것으로 연구중인데... 잘안되네요.. 수정할 부분좀 알려주세요.