YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > PHP
검색
멤버이름    오토
비밀번호 
 

이미지 새창에 띄우고. 창크기 조정 스크롤

페이지 정보

작성자 MintState 댓글 0건 조회 20,997회 작성일 08-10-28 13:30

본문

이미지 새창에 띄우고. 창크기 조정 스크롤 

//본문
<script> 
function big_img(img)
{                
        a_win = window.open("view_img.php?img=" + img,"popwin", "width=520 ,height=400,resizable=yes,scrollbars=no");
        a_win.focus();
}
</script>

<a href='javascript:big_img("http://user.chol.com/~story1/jioworld/U.jpg")'><img src=http://user.chol.com/~story1/jioworld/U.jpg width=200 border=0></a>


//새창띄우기후 조정 소스  view_img.php
<html>
<head>
<title>YESYO.COM ::이미지 보기::</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
</head>

<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad="fitWindowSize();">

<SCRIPT LANGUAGE="JavaScript">

var ie = 1;
var windowX, windowY;
var bLargeImage = 0;
var x,y;

var InitX = 500;

// 이미지가 새창에 맞게 조절되는 부분
function fitWindowSize()   
{
if( ie )
{
window.resizeTo( InitX, InitX );
width  = InitX - (document.body.clientWidth  - document.images[0].width);
height = InitX - (document.body.clientHeight - document.images[0].height);
windowX = (window.screen.width-width)/2;
windowY = (window.screen.height-height)/2;
if( width > screen.width-50 )
{
width = screen.width-50;
windowX = 20;
bLargeImage = 1;
}
if( height > screen.height-80 )
{
height = screen.height-80;
windowY = 20;
bLargeImage = 1;
}
window.moveTo( windowX, windowY );
window.resizeTo( width, height+4 );
}
else
{
window.innerWidth  = document.layers[0].document.images[0].width;
window.innerHeight = document.layers[0].document.images[0].height;
}
}

// 휠마우스 효과
function move() {
if(bLargeImage){  window.scroll(window.event.clientX - 50,window.event.clientY -50);
}
}

// 오른쪽 왼쪽 마우스 클릭시 창닫는 부분
function click() { 
if ((event.button==1) || (event.button==2) || (event.button==3)) {
top.self.close();
}
}
document.onmousedown=click
</script>
<Table width="100%" cellpadding="0" border="0" cellspacing="0">
<tr>
<td valign="middle" align="center">
<img src="<?=$img?>" border="0"  ONMOUSEMOVE="move();">
</td>
</tr>
</table>
</body>
</html>

댓글목록

등록된 댓글이 없습니다.

Total 165건 1 페이지
PHP 목록
번호 제목 글쓴이 조회 날짜
165 MintState 30359 11-10
164 MintState 28701 01-13
163 MintState 26089 11-03
162 MintState 24488 11-03
161 MintState 24020 10-28
160 MintState 23539 04-09
159 MintState 23333 11-03
158 MintState 22928 10-28
157 MintState 22452 04-28
156 MintState 22247 11-17
155 MintState 21894 04-18
154 MintState 21154 11-10
열람중 MintState 20998 10-28
152 MintState 20702 11-10
151 MintState 20549 11-03
150 MintState 20197 11-10
149 MintState 20044 07-02
148 MintState 19882 11-10
147 MintState 19851 11-03
146 MintState 19537 11-03
145 MintState 19195 11-03
144 MintState 18588 11-03
143 MintState 18585 04-28
142 MintState 18342 07-02
141 MintState 18198 08-25
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™