마우스 클릭시 사진이 나오게 하고 싶어요 정보
마우스 클릭시 사진이 나오게 하고 싶어요본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 : http://www.baekgumsoon.com/edasom/bbs/board.php?bo_table=d02&wr_id=3
위 게시판인데요 현재는 마우스 오버를 하면 이미지가 위에 나타납니다.
이것을 아래 썸네일 이미지 클릭시 위에 이미지가 나타나게하고자합니다.
소스중 아래 소스에서 수정을 하면될것같은데 잘 안되네요 조언부탁드립니다.
오류 주소 : http://www.baekgumsoon.com/edasom/bbs/board.php?bo_table=d02&wr_id=3
위 게시판인데요 현재는 마우스 오버를 하면 이미지가 위에 나타납니다.
이것을 아래 썸네일 이미지 클릭시 위에 이미지가 나타나게하고자합니다.
소스중 아래 소스에서 수정을 하면될것같은데 잘 안되네요 조언부탁드립니다.
<!--작은사진목록-->
<td bgcolor="#000000" style="padding:4 0 4 0px;" width="580" height="120" align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%" valign='top'>
<tr>
<td style="border:solid 1px #D3D3D3; background-color:#000000; " valign='top'>
<tr>
<?
//파일 뽑기
$sql = " select bf_file, bf_source from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no limit 0, 36 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
if($i != 0 && $i % 6 == 0) echo "</tr><tr><td colspan='3' style='height:7px;'></td></tr><tr>";
if($i % 6 != 0) echo "<td width=10></td>";
$view_w = 580; //썸네일 가로사이즈
$view_h = 400; //썸네일 세로사이즈
$sch_q = 100; //썸네일 퀼리티
if (!is_dir($thumb_path2)) {
@mkdir($thumb_path2, 0707);
@chmod($thumb_path2, 0707);
}
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $row[bf_file]; //파일명
$thumb2 = $thumb_path2.'/'.$filename; //썸네일
if (!file_exists($thumb2)) { //view 용 이미지 생성
$file = $data_path.'/'.$filename; //원본
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $view_h / $size[1];
//$width = (int)($size[0] * $rate);
$width = 580; //가로 사이즈 고정
//echo "rate : $rate ,width : $width, $height : $board[bo_2] <br>";
if($width <= $view_w) { //width가 지정된 사이즈보다 작을경우 rate 비율로 썸네일 생성
$dst = imagecreatetruecolor($width, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $view_h, $size[0], $size[1]);
imagepng($dst, $thumb_path2.'/'.$filename, $sch_q);
} else {
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($view_w, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path2.'/'.$filename, $sch_q);
}
chmod($thumb_path2.'/'.$filename, 0707);
}
}
$view_w = 88; //썸네일 가로사이즈
$view_h = 66; //썸네일 세로사이즈
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb)) { //기본 썸네일
$file = $data_path.'/'.$filename; //원본
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file)) {
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
continue;
$rate = $view_h / $size[1];
//$width = (int)($size[0] * $rate);
$width = 88;
//echo "rate : $rate ,width : $width, $height : $board[bo_2] <br>";
if($width <= $view_w) { //width가 지정된 사이즈보다 작을경우 rate 비율로 썸네일 생성
$dst = imagecreatetruecolor($width, $view_h);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $view_h, $size[0], $size[1]);
$dst = UnsharpMask($dst, 80, 0.5, 3);
imagepng($dst, $thumb_path.'/'.$filename, $sch_q);
} else {
$rate = $view_w / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($view_w, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $view_w, $height, $size[0], $size[1]);
$dst = UnsharpMask($dst, 80, 0.5, 3);
imagepng($dst, $thumb_path.'/'.$filename, $sch_q);
}
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
?>
<td style="border:solid 1px #D0D0D0;height:66px;width:88px;" align='left' width=88 height=66>
<a rel="enlargeimage::mouseover" rev="loadarea" href="<?=$thumb_path2?>/<?=$filename?>"><img src="<?=$thumb?>" style="border-width:0px;" /></a>
</td>
<?
//onMouseOut="bgChange('clear');"
}
}
?>
<? for($c = 0; $c < (6 - ($i-1 % 6)); $c ++) echo "<td width=10></td><td width=88 height=66></td>"; ?>
</tr>
</table>
</td>
</tr>
</table>
댓글 전체
openwindow() 를 활용해 보세요
오픈윈도우소스를 어디에 삽입해야하는지 몰라서요.. 자세히좀 부탁해요~
마우스 오버 를 클릭으로 변경한다는건가요? 아니면 팝업인가;;
오버를 클릭이면 그냥 소스중에
rel="enlargeimage::mouseover"
이걸
rel="enlargeimage::onclick" 이걸로 바꾸면 안될까요? ㅋ 안되려나 ^.^;;
안될경우...
소스중에... thumbnailviewer2.js 파일 여기서 찾아 수정 하면 될거 같기도 하고;;; 넘어렵다 ㅋ
오버를 클릭이면 그냥 소스중에
rel="enlargeimage::mouseover"
이걸
rel="enlargeimage::onclick" 이걸로 바꾸면 안될까요? ㅋ 안되려나 ^.^;;
안될경우...
소스중에... thumbnailviewer2.js 파일 여기서 찾아 수정 하면 될거 같기도 하고;;; 넘어렵다 ㅋ