새창없이 창띄우기 - 응용
페이지 정보
작성자 서방님 댓글 1건 조회 90회 작성일 06-11-17 09:55본문
<html>
<head>
<title>sample</title>
<script>
function Content(s,url)
{
var a = eval("document.all.info");
if(s)
{
a.style.top = 0;
a.style.left = 0;
a.style.display = "";
tg.innerHTML="<img src=" + url + " style='cursor:hand;border:solid 1 #000000;'>";
}
else
{
a.style.display = "none";
tg.innerHTML = "";
}
}
// 해상도에 따라서 항상 중앙에 위치합니다.
window.onload = fnInit; // 페이지가 로딩되면 함수 fnInit() 를 실행합니다
function fnInit() {
infoView.style.setExpression("left", "document.body.clientWidth/2 - infoView.offsetWidth/2"); // 레이어의 x 축 위치를 설정 합니다
infoView.style.setExpression("top", "document.body.clientHeight/2 - infoView.offsetHeight/2"); // 레이어의 y축 위치를 설정 합니다
}
</script>
</head>
<body style='margin:0;'>
<table align='center'>
<tr>
<td>
<a onclick="Content(true,'http://ssoflower.com/data/item/1149002244_l1');" style='cursor:hand;'><img src="http://ssoflower.com/data/item/1149002244_l1" style='cursor:hand;border:solid 1 #000000;' width="100" height="100"></a>
<a onclick="Content(true,'http://ssoflower.com/data/item/1149006514_l1');" style='cursor:hand;'><img src="http://ssoflower.com/data/item/1149006514_l1" style='cursor:hand;border:solid 1 #000000;' width="100" height="100"></a>
<a onclick="Content(true,'http://ssoflower.com/images/banner/ssoflower.gif');" style='cursor:hand;'><img src="http://ssoflower.com/images/banner/ssoflower.gif" style='cursor:hand;border:solid 1 #000000;' width="100" height="100"></a>
</td>
</tr>
</table>
<div id="info" style="position:absolute; display:none; width:100%; height:100%;">
<div ID="infoView" STYLE="position: absolute;">
<div id="tg" onclick="Content(false);"></div>
</div>
<table cellpadding='0' cellspacing='0' border='0' style='width:100%; height:100%; background-color:#000000; filter:Alpha(opacity=30); opacity:0.3; -moz-opacity:0.3;'>
<tr>
<td></td>
</tr>
</table>
</div>
</body>
</html>
댓글목록
서방님님의 댓글
서방님 작성일
<P>스크립트 부분을..</P>
<P><script><BR>function Content(s,url)<BR>{<BR> var a = eval("document.all.info");<BR> if(s)<BR> {<BR> a.style.top = 0;<BR> a.style.left = 0;<BR> a.style.display = "";<BR> tg.innerHTML="<img src=" + url + " style='cursor:hand;border:solid 1 #000000;'>";<BR> fnInit();<BR> }<BR> else<BR> {<BR> a.style.display = "none";<BR> tg.innerHTML = "";<BR> }<BR>}</P>
<P>// 해상도에 따라서 항상 중앙에 위치합니다.<BR>// window.onload = fnInit; // 페이지가 로딩되면 함수 fnInit() 를 실행합니다<BR>function fnInit() {<BR> infoView.style.setExpression("left", "document.body.clientWidth/2 - infoView.offsetWidth/2"); // 레이어의 x 축 위치를 설정 합니다<BR> infoView.style.setExpression("top", "document.body.clientHeight/2 - infoView.offsetHeight/2"); // 레이어의 y축 위치를 설정 합니다<BR>}<BR></script></P>
<P>이걸로..<BR></P>