새창없이 창띄우기 - 응용 > script

본문 바로가기
사이트 내 전체검색

script

새창없이 창띄우기 - 응용

페이지 정보

작성자 서방님 댓글 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>&lt;script&gt;<BR>function Content(s,url)<BR>{<BR>&nbsp;var a = eval("document.all.info");<BR>&nbsp;if(s)<BR>&nbsp;{<BR>&nbsp; a.style.top = 0;<BR>&nbsp; a.style.left = 0;<BR>&nbsp; a.style.display = "";<BR>&nbsp; tg.innerHTML="&lt;img src=" + url + " style='cursor:hand;border:solid 1 #000000;'&gt;";<BR>&nbsp; fnInit();<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;{<BR>&nbsp; a.style.display = "none";<BR>&nbsp; tg.innerHTML = "";<BR>&nbsp;}<BR>}</P>
<P>// 해상도에 따라서 항상 중앙에 위치합니다.<BR>// window.onload = fnInit; // 페이지가 로딩되면 함수 fnInit() 를 실행합니다<BR>function fnInit() {<BR>&nbsp;infoView.style.setExpression("left", "document.body.clientWidth/2 - infoView.offsetWidth/2"); // 레이어의 x 축 위치를 설정 합니다<BR>&nbsp;infoView.style.setExpression("top", "document.body.clientHeight/2 - infoView.offsetHeight/2"); // 레이어의 y축 위치를 설정 합니다<BR>}<BR>&lt;/script&gt;</P>
<P>이걸로..<BR></P>

Total 846건 47 페이지
게시물 검색

회원로그인

접속자집계

오늘
27
어제
302
최대
1,347
전체
155,088
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.