갤러리 리스트에 썸네일 마우스 오버시 이미지 겹치게 하기.. 정보
갤러리 리스트에 썸네일 마우스 오버시 이미지 겹치게 하기..본문
첨부파일 올리면 자동으로 썸네일도 생성이 되잖아요?
여기에 고정 이미지를 하나 올려놓고
마우스 오버하면 그 이미지가 겹쳐서 나오게 하려고 합니다..겹칠 이미지는 PNG로 해서
생성된 썸내일이 뒤쪽에 보여야 하는거죠..
해보긴 했는데 오버시 이미지가 겹치는게 아니구 그 해당 이미지로 바뀌게 되는거라
게시판 뒷 배경이 나오는데요...
어떻게 하면 좋을까요???
for ($i=0; $i<count($list); $i++)
{
$img = "<img src='$board_skin_path/img/noimage.gif' border=0 title='이미지 없음' >";
$image = $list[$i][file][0][file];
$image1 = $list[$i][file][1][file];
$thumb = $thumb_path.'/'.$list[$i][file][0][file];
$thumb1 = $board_skin_path.'/img/01.png';
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
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 = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thumb_height)
$dst = imagecreatetruecolor($thumb_width, $height);
else
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
/*imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][file][0][file], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][file][0][file], 0606);*/
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][file][0][file], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][file][0][file], 0606);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb) && $list[$i][file][0][file]) {
$img = "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='{$thumb}' width='{$thumb_width}' height='{$thumb_height}' border=1 style='border:1px solid #ffffff;'onmouseover=\"this.src='{$thumb1}'; this.style.cursor='hand'\" onmouseout=\"this.src='{$thumb}';\"></a>";
} else {
preg_match("`<\s*img\s+src\s*=\s*['|\"]?([^'|\"\s]+://[^'|\"\s]+\.(gif|jpe?g|png))['|\"]?\s*[^>]+`i", $list[$i]['wr_content'], $images);
if (!empty($images[1])) {
$img_size = GetImageSize("$images[1]");
if($img_size[0] >= $img_size[1]) {
$imgper = $thumb_width/$img_size[0];
$thumb_height = $img_size[1]*$imgper;
}else{
$imgper = $thumb_height/$img_size[1];
$thumb_width = $img_size[0]*$imgper;
}
$img = "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='{$images[1]}' width='{$thumb_width}' height='{$thumb_height}' align='absmiddle' border='0'></a>";
} else {
echo "";
}
}
여기에 고정 이미지를 하나 올려놓고
마우스 오버하면 그 이미지가 겹쳐서 나오게 하려고 합니다..겹칠 이미지는 PNG로 해서
생성된 썸내일이 뒤쪽에 보여야 하는거죠..
해보긴 했는데 오버시 이미지가 겹치는게 아니구 그 해당 이미지로 바뀌게 되는거라
게시판 뒷 배경이 나오는데요...
어떻게 하면 좋을까요???
for ($i=0; $i<count($list); $i++)
{
$img = "<img src='$board_skin_path/img/noimage.gif' border=0 title='이미지 없음' >";
$image = $list[$i][file][0][file];
$image1 = $list[$i][file][1][file];
$thumb = $thumb_path.'/'.$list[$i][file][0][file];
$thumb1 = $board_skin_path.'/img/01.png';
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
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 = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thumb_height)
$dst = imagecreatetruecolor($thumb_width, $height);
else
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
/*imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][file][0][file], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][file][0][file], 0606);*/
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][file][0][file], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][file][0][file], 0606);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $thumb_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb) && $list[$i][file][0][file]) {
$img = "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='{$thumb}' width='{$thumb_width}' height='{$thumb_height}' border=1 style='border:1px solid #ffffff;'onmouseover=\"this.src='{$thumb1}'; this.style.cursor='hand'\" onmouseout=\"this.src='{$thumb}';\"></a>";
} else {
preg_match("`<\s*img\s+src\s*=\s*['|\"]?([^'|\"\s]+://[^'|\"\s]+\.(gif|jpe?g|png))['|\"]?\s*[^>]+`i", $list[$i]['wr_content'], $images);
if (!empty($images[1])) {
$img_size = GetImageSize("$images[1]");
if($img_size[0] >= $img_size[1]) {
$imgper = $thumb_width/$img_size[0];
$thumb_height = $img_size[1]*$imgper;
}else{
$imgper = $thumb_height/$img_size[1];
$thumb_width = $img_size[0]*$imgper;
}
$img = "<a href='{$list[$i][href]}' onfocus='this.blur()'><img src='{$images[1]}' width='{$thumb_width}' height='{$thumb_height}' align='absmiddle' border='0'></a>";
} else {
echo "";
}
}
댓글 전체