shop/popupimage.php 파일을 아래의 코드로 만듭니다.
<?
include_once("./_common.php");$g4[title] = "팝업이미지";
include_once("$g4[path]/head.sub.php");$size = getimagesize($img);
$type = $size[2];
if (!($type == 1 || $type == 2 || $type == 3)) {
echo "<script> alert('이미지 파일이 아닙니다.'); window.close(); </script>";
exit;
}
echo "<img id='popupimage' src='$img' $size[3] />";
$width = $size[0] + 15;
$height = $size[1] + 32;
?>
<script>
$(function() {
window.resizeTo(<?=$width?>,<?=$height?>);
window.moveTo(parseInt(screen.width/2)-parseInt(<?=$width?>/2), (screen.height/2)-parseInt(<?=$height?>/2));$('#popupimage').click(function() {
window.close();
}).css('cursor', 'pointer').attr('title', '클릭하시면 창이 닫힙니다.');
});
</script>
<?
include_once("$g4[path]/tail.sub.php");
?>
shop/item.php 에 코드를 추가합니다.
<script>
$(function() {
$('#div_explan img').each(function() {
$(this).click(function() {
window.open('./popupimage.php?img='+this.src, 'popupimage', 'status=0,scrollbars=0,resizable=1');
})
.css('cursor', 'pointer')
.attr('title', '클릭하시면 원본이미지를 볼 수 있습니다.');
});
});
</script>
댓글 3개
게시글 목록
| 번호 | 제목 |
|---|---|
| 1681 | |
| 1678 | |
| 1677 | |
| 1676 | |
| 1675 | |
| 1672 | |
| 1654 | |
| 1644 | |
| 1636 | |
| 1633 | |
| 1626 | |
| 1621 | |
| 1613 | |
| 1612 | |
| 1607 | |
| 1558 | |
| 1554 | |
| 1545 | |
| 1542 | |
| 1539 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기