묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
이미지 클릭시 창닫기!!!! 제발.. 부탁드립니다.
2003.01.05 01:11
아래 갤러리 소스가 있습니다.
같은 폴더에 있는 이미지를 보여주는 거랍니다. ^^;;;;
어떤분의 소스를 수정중인데.. 누구였는지 기억이.. 죄송합니다. 혹시라도 주인님이 보신다면 사죄, 거듭 사죄를 드립니다.
질문은,
출력된 이미지가 새창으로 띄워집니다.
그런데, 이 새창을 닫으로면 윈도우의 x 표로만 닫아지거든요~
그래서, 그림 클릭시 새창을 닫고 싶네요....
여기에 어떤게 추가를 해야할지..(어디에 넣을지도 모르겠네요...). 초보라서 잘 모르겠습니다.
좀 급한데.. 아시는분, 번거로우시더라도 제발 리플좀 달아주세요~~~~
부탁을 드리겠습니다. ^^* 제발~~~~ 감사합니다.
<STYLE TYPE='text/css'>
A:link { color: #52689A; text-decoration:none; }
A:visited { color: #52689A; text-decoration:none; }
A:active { text-decoration:none; }
A:hover { color: #52689A; text-decoration:none; }
.small { font-family:돋움; font-size:8pt }
.norm { font-family:굴림; font-size:9pt }
.big { font-family:굴림; font-size:14pt }
.button { height:19px; border-width:1; border-style:ridge; border-color:#d0d0d0; background-color:#dfdfdf;}
.editbox { border:1 solid black; background-color:white; }
.admin { border:1 solid black; background-color:white; }
select { background-color:white;}
p,br,body,table,td,select,input,form,textarea,option { font-family:굴림; font-size:9pt; }
</STYLE>
<?
//$code = 파일확장자
//$imagefile = 그림파일명
//$imagewidth = 이미지의 가로길이
//$imageheight = 이미지의 세로길이
//$page = 페이지번호
$tdwidth = 100; // 테이블 한칸의 가로길이
$tdheight = 100; // 테이블 한칸의 세로길이
$imggaro = 5; // 그림 가로 출력 갯수
$imgsero = 3; // 그림 세로 출력 갯수
$viewimg = $imggaro * $imgsero; // 한화면의 그림 출력 갯수
?>
<html>
<head>
<title>mogoon.com</title>
<style>
img { border:none;}
</style>
</head>
<body>
<?
$handle=opendir("."); //시작할 폴더위치를 지정한다.
//그림파일 전체 갯수 구함
while ($imagefile = readdir($handle))
{
$code = substr($imagefile,-3); //확장자검색
if($code == jpg || $code == gif) //그림파일확인
{
$num++;
}
}
echo(" <center>mogoon의 디카 페이지<br>");
echo(" <a href='#' onClick=window.open'+ '+ 'http://mogoon.com','')><b>-mogoon.com-</b></a><br><br>");
echo(" 그림파일 : $num 개");
if($page == "" || $page == "0" || $page == "1")
{
$page = "1";
}
//NEXT , PREVIEW 만들기.
$next = $page+1;
$preview = $page-1;
if($page == 1)
{
echo("<font color=red>[ ◀이전 ]</font> ");
echo("<a href=$PHP_SELF?page=$next><b><b><font color=red>[ 다음▶ ]</font></b></a> <br>");
}
else if($page == intval($num/$viewimg)+1)
{
echo("<a href=$PHP_SELF?page=$preview><b><font color=red>[ ◀이전 ]</font></b></a> ");
echo("<font color=red>[ 다음▶ ]</font> <br>");
}
else
{
echo("<a href=$PHP_SELF?page=$preview><b><font color=red>[ ◀이전 ]</font></b></a> ");
echo("<a href=$PHP_SELF?page=$next><b><font color=red>[ 다음▶ ]</font></b></a> <br>");
}
//페이지 설정
$for = intval($num/$viewimg)+1;
for($i=1; $i <= $for; $i++)
{
if($page == $i)
{
echo("<a href=$PHP_SELF?page=$i><b><font color=red>[$i]</font></b></a> ");
}
else
{
echo("<a href=$PHP_SELF?page=$i>[$i]</a> ");
}
}
closedir($handle);
?>
<table border=0>
<tr>
<?
$handle=opendir("."); //시작할 폴더위치를 지정한다.
while ($imagefile = readdir($handle))
{
$code = substr($imagefile,-3); //확장자검색
if($code == jpg || $code == gif) //그림파일확인
{
$k++;
if( $k > (($viewimg*$page)-$viewimg) && $k <= ($viewimg*$page)) //나타내야할 부분 추출 한다.
{
$imagehw = GetImageSize($imagefile); // 이미지 사이크를 구함.
$imagewidth = $imagehw[0]; // 이미지 가로길이
$imageheight = $imagehw[1]; // 이미지 세로길이
$imagewidth20 = $imagewidth+20;
$imageheight20 = $imageheight+20;
// 이미지 가로길이가 테이블 한칸 가로길이보다 클경우
if($imagewidth >= $tdwidth)
{
$x = $imagewidth/$tdwidth;
$imageheight = intval($imageheight/$x);
$imagewidth = $tdwidth;
}
// 이미지 세로길이가 테이블 한칸 세로길이보다 클경우
if($imageheight > $tdheight)
{
$x = $imageheight/$tdheight;
$imagewidth = intval($imagewidth/$x);
$imageheight = $tdheight;
}
//그림 세로 출력수
if($sero < $imgsero)
{
echo("<td align=center valign=middle width=$tdwidth height=$tdheight><a href='#' onClick=window.open('$imagefile','','scrollbars=no,width=$imagewidth20,height=$imageheight20')><img src=$imagefile width=$imagewidth height=$imageheight></a></td>n");
$garo++;
//그림 가로 출력수
if($garo%$imggaro == 0)
{
$sero++;
if($sero != $imgsero)
{
echo("</tr>n<tr>n");
}
}
}
}
}
}
closedir($handle);
?>
</tr>
</table>
</body>
</html>
같은 폴더에 있는 이미지를 보여주는 거랍니다. ^^;;;;
어떤분의 소스를 수정중인데.. 누구였는지 기억이.. 죄송합니다. 혹시라도 주인님이 보신다면 사죄, 거듭 사죄를 드립니다.
질문은,
출력된 이미지가 새창으로 띄워집니다.
그런데, 이 새창을 닫으로면 윈도우의 x 표로만 닫아지거든요~
그래서, 그림 클릭시 새창을 닫고 싶네요....
여기에 어떤게 추가를 해야할지..(어디에 넣을지도 모르겠네요...). 초보라서 잘 모르겠습니다.
좀 급한데.. 아시는분, 번거로우시더라도 제발 리플좀 달아주세요~~~~
부탁을 드리겠습니다. ^^* 제발~~~~ 감사합니다.
<STYLE TYPE='text/css'>
A:link { color: #52689A; text-decoration:none; }
A:visited { color: #52689A; text-decoration:none; }
A:active { text-decoration:none; }
A:hover { color: #52689A; text-decoration:none; }
.small { font-family:돋움; font-size:8pt }
.norm { font-family:굴림; font-size:9pt }
.big { font-family:굴림; font-size:14pt }
.button { height:19px; border-width:1; border-style:ridge; border-color:#d0d0d0; background-color:#dfdfdf;}
.editbox { border:1 solid black; background-color:white; }
.admin { border:1 solid black; background-color:white; }
select { background-color:white;}
p,br,body,table,td,select,input,form,textarea,option { font-family:굴림; font-size:9pt; }
</STYLE>
<?
//$code = 파일확장자
//$imagefile = 그림파일명
//$imagewidth = 이미지의 가로길이
//$imageheight = 이미지의 세로길이
//$page = 페이지번호
$tdwidth = 100; // 테이블 한칸의 가로길이
$tdheight = 100; // 테이블 한칸의 세로길이
$imggaro = 5; // 그림 가로 출력 갯수
$imgsero = 3; // 그림 세로 출력 갯수
$viewimg = $imggaro * $imgsero; // 한화면의 그림 출력 갯수
?>
<html>
<head>
<title>mogoon.com</title>
<style>
img { border:none;}
</style>
</head>
<body>
<?
$handle=opendir("."); //시작할 폴더위치를 지정한다.
//그림파일 전체 갯수 구함
while ($imagefile = readdir($handle))
{
$code = substr($imagefile,-3); //확장자검색
if($code == jpg || $code == gif) //그림파일확인
{
$num++;
}
}
echo(" <center>mogoon의 디카 페이지<br>");
echo(" <a href='#' onClick=window.open'+ '+ 'http://mogoon.com','')><b>-mogoon.com-</b></a><br><br>");
echo(" 그림파일 : $num 개");
if($page == "" || $page == "0" || $page == "1")
{
$page = "1";
}
//NEXT , PREVIEW 만들기.
$next = $page+1;
$preview = $page-1;
if($page == 1)
{
echo("<font color=red>[ ◀이전 ]</font> ");
echo("<a href=$PHP_SELF?page=$next><b><b><font color=red>[ 다음▶ ]</font></b></a> <br>");
}
else if($page == intval($num/$viewimg)+1)
{
echo("<a href=$PHP_SELF?page=$preview><b><font color=red>[ ◀이전 ]</font></b></a> ");
echo("<font color=red>[ 다음▶ ]</font> <br>");
}
else
{
echo("<a href=$PHP_SELF?page=$preview><b><font color=red>[ ◀이전 ]</font></b></a> ");
echo("<a href=$PHP_SELF?page=$next><b><font color=red>[ 다음▶ ]</font></b></a> <br>");
}
//페이지 설정
$for = intval($num/$viewimg)+1;
for($i=1; $i <= $for; $i++)
{
if($page == $i)
{
echo("<a href=$PHP_SELF?page=$i><b><font color=red>[$i]</font></b></a> ");
}
else
{
echo("<a href=$PHP_SELF?page=$i>[$i]</a> ");
}
}
closedir($handle);
?>
<table border=0>
<tr>
<?
$handle=opendir("."); //시작할 폴더위치를 지정한다.
while ($imagefile = readdir($handle))
{
$code = substr($imagefile,-3); //확장자검색
if($code == jpg || $code == gif) //그림파일확인
{
$k++;
if( $k > (($viewimg*$page)-$viewimg) && $k <= ($viewimg*$page)) //나타내야할 부분 추출 한다.
{
$imagehw = GetImageSize($imagefile); // 이미지 사이크를 구함.
$imagewidth = $imagehw[0]; // 이미지 가로길이
$imageheight = $imagehw[1]; // 이미지 세로길이
$imagewidth20 = $imagewidth+20;
$imageheight20 = $imageheight+20;
// 이미지 가로길이가 테이블 한칸 가로길이보다 클경우
if($imagewidth >= $tdwidth)
{
$x = $imagewidth/$tdwidth;
$imageheight = intval($imageheight/$x);
$imagewidth = $tdwidth;
}
// 이미지 세로길이가 테이블 한칸 세로길이보다 클경우
if($imageheight > $tdheight)
{
$x = $imageheight/$tdheight;
$imagewidth = intval($imagewidth/$x);
$imageheight = $tdheight;
}
//그림 세로 출력수
if($sero < $imgsero)
{
echo("<td align=center valign=middle width=$tdwidth height=$tdheight><a href='#' onClick=window.open('$imagefile','','scrollbars=no,width=$imagewidth20,height=$imageheight20')><img src=$imagefile width=$imagewidth height=$imageheight></a></td>n");
$garo++;
//그림 가로 출력수
if($garo%$imggaro == 0)
{
$sero++;
if($sero != $imgsero)
{
echo("</tr>n<tr>n");
}
}
}
}
}
}
closedir($handle);
?>
</tr>
</table>
</body>
</html>
댓글 4
글쓴이 | 제목 | 최종 글 |
---|---|---|
XE | 공지 글 쓰기,삭제 운영방식 변경 공지 [16] | 2019.03.05 by 남기남 |
sbvision | 포토항목에 관리그룹지정 건 | |
노력중.. | 비추천수 본인만 확인할수있는방법? [6] | 2015.05.18 by 키스미베이베 |
Day459d2 | XE에서 사용 가능한 함수들은 어디서 볼 수 있나요? | |
jinoossi | Fatal error | |
김동하123 | 마켓플레이스 조회수가 안 올라갑니다. | |
jblref |
트윗 담아가기를 게시판에서 사용하려면?
[1]
![]() | 2015.05.18 by jblref |
줄앤짐 | XE 모바일 화면을 만들려고 하는데요. [2] | 2015.05.18 by 줄앤짐 |
줄앤짐 |
XEdition Demo 부분에서 중간에 나오는 내용은 어디서 수정하나요??
[2]
![]() | 2015.05.18 by 줄앤짐 |
inJin | 외부페이지나 문서페이지를 통해서 메인화면을 만들고 싶은데요 [4] | 2015.05.18 by inJin |
inJin |
이 오류가 왜 이렇게 자주뜰까요 하..
[2]
![]() | 2015.05.18 by inJin |
사이버디 | 관리자'로 로그인시도하면 나오는 메시지 [2] | 2015.05.18 by 사이버디 |
영호발경한 | 개념설명 [1] | 2015.05.18 by 보고 |
피토크라에스 | 추천수 - 비추천수 합산값을 추천수에 출력하는방법 [6] | 2015.05.18 by 피토크라에스 |
포레바 | Ckeditor 사용시 첨부가능용량 표기 문제 | |
아자잣 | 제로보드 용량수정 문제 (초보) [1] | 2015.05.18 by 아형여옹 |
ㅎㅕㄴㅣㄴㅔ | 코드해석? | |
katekim |
글내용 보호기능을 하고싶어요 (특정내용은 *로 표시)
[5]
![]() | 2015.05.18 by katekim |
경주고을아낙네 | 에러메시지.... | |
1000g | 관리자를 제외하고 회원들만 익명으로 설정할 수 없나요? [2] | 2015.05.18 by bin |
푸히히힛 | Fatal error |