[스크립트] z-index 롤오버용 레이어
페이지 정보
작성자 관리자 작성일15-07-16 08:16 조회2,435회 댓글0건본문
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script language="JavaScript">
<!--
function YB_findObj(n,d){
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document; 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.length;i++) x=YB_findObj(n,d.layers[i].document); return x;
}
function YB_showHideLayers(){
var i,p,v,obj,args=YB_showHideLayers.arguments;
for(i=0;i<(args.length-2); i+=3) if ((obj=YB_findObj(args[i]))!=null){ v=args[i+2];
if(obj.style) {obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v;}
obj.visibility=v;}
}
//-->
</script>
</HEAD>
<BODY>
<div id="Layer1" style="position:absolute; top:415px; z-index:3; visibility:show;">
<a OnMouseOver="YB_showHideLayers('Layer1','','show','Layer2','','hide');" style='cursor:hand'>
<b>으히히히</b></a>
<a OnMouseOver="YB_showHideLayers('Layer1','','hide','Layer2','','show');" style='cursor:hand'>
우아아아아아아</a>
<p>ssssssssssssssssssssssssss</p>
</div>
<div id="Layer2" style="position:absolute; top:415px; z-index:2; visibility:hidden;">
<a OnMouseOver="YB_showHideLayers('Layer1','','show','Layer2','','hide');" style='cursor:hand'>
<b> 머머머머</b></a>
<a OnMouseOver="YB_showHideLayers('Layer1','','hide','Layer2','','show');" style='cursor:hand'>
마마마마</a>
<p>qqqqqqqqqqqqqqqqqqqqqqqq</p>
</div>
</BODY>
</HTML>
<HTML>
<HEAD>
<script language="JavaScript">
<!--
function YB_findObj(n,d){
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
d=parent.frames[n.substring(p+1)].document; 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.length;i++) x=YB_findObj(n,d.layers[i].document); return x;
}
function YB_showHideLayers(){
var i,p,v,obj,args=YB_showHideLayers.arguments;
for(i=0;i<(args.length-2); i+=3) if ((obj=YB_findObj(args[i]))!=null){ v=args[i+2];
if(obj.style) {obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v;}
obj.visibility=v;}
}
//-->
</script>
</HEAD>
<BODY>
<div id="Layer1" style="position:absolute; top:415px; z-index:3; visibility:show;">
<a OnMouseOver="YB_showHideLayers('Layer1','','show','Layer2','','hide');" style='cursor:hand'>
<b>으히히히</b></a>
<a OnMouseOver="YB_showHideLayers('Layer1','','hide','Layer2','','show');" style='cursor:hand'>
우아아아아아아</a>
<p>ssssssssssssssssssssssssss</p>
</div>
<div id="Layer2" style="position:absolute; top:415px; z-index:2; visibility:hidden;">
<a OnMouseOver="YB_showHideLayers('Layer1','','show','Layer2','','hide');" style='cursor:hand'>
<b> 머머머머</b></a>
<a OnMouseOver="YB_showHideLayers('Layer1','','hide','Layer2','','show');" style='cursor:hand'>
마마마마</a>
<p>qqqqqqqqqqqqqqqqqqqqqqqq</p>
</div>
</BODY>
</HTML>
댓글목록
등록된 댓글이 없습니다.