[스크립트] 간단한 레이어 구조, z-index
페이지 정보
작성자 관리자 작성일15-07-16 08:16 조회2,303회 댓글0건본문
<html>
<head>
<script language=JavaScript>
function z_arg()
{
layer1.style.zIndex = "2";
layer2.style.zIndex = "1";
}
function z_arange()
{
layer1.style.zIndex = "1";
layer2.style.zIndex = "2";
}
</script>
</head>
<body>
<div id="layer1" style="width:200px; height:200px; position:absolute; left:10px; top:51px; background-color:#FFFF00; z-index:2;" onclick="z_arg()">
aaaaa
</div>
<div id="layer2" style="width:200px; height:200px; position:absolute; left:30px; top:100px; background-color:#00FFFF; z-index:1;" onclick="z_arange()">
zzzzz
</div>
</body>
</html>
<head>
<script language=JavaScript>
function z_arg()
{
layer1.style.zIndex = "2";
layer2.style.zIndex = "1";
}
function z_arange()
{
layer1.style.zIndex = "1";
layer2.style.zIndex = "2";
}
</script>
</head>
<body>
<div id="layer1" style="width:200px; height:200px; position:absolute; left:10px; top:51px; background-color:#FFFF00; z-index:2;" onclick="z_arg()">
aaaaa
</div>
<div id="layer2" style="width:200px; height:200px; position:absolute; left:30px; top:100px; background-color:#00FFFF; z-index:1;" onclick="z_arange()">
zzzzz
</div>
</body>
</html>
댓글목록
등록된 댓글이 없습니다.