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

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

페이지 정보

작성자 MintState 댓글 0건 조회 21,001회 작성일 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건 7 페이지
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™