최신글 롤오버시 이미지 페이드 정보
최신글 롤오버시 이미지 페이드관련링크
http://galleryis.artdot.kr/
161회 연결
본문
안녕하세요
링크 사이트 보시면
메인에 최근이미지추출이 되어 있는데 우측 1.2.3.4 버튼에 롤오버나 onclick 시
해당 게시글 내용이 출력이 되는데 이미지에 페이드 효과를 주고 싶은데
어떻게 해야 할까요 ^^;
이미지가 너무 딱딱하게 나와서 페이드인 좀 줄려고 하는데 방법이...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 546;
$img_height = 435;
$img_quality = 100;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_G7';
$ym = date("ym", $g4[server_time]);
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
//코멘트와 리플글은 제외
$sql = " select * from $tmp_write_table
where wr_comment = '' and wr_reply = ''
order by wr_id DESC LIMIT 0, 1 ";
$result = sql_query($sql);
$last_con = sql_fetch_array($result);
?>
<SCRIPT type=text/javascript>
<!--
old_debate_G7='1';
function ComeonG7(objid_G7){
document.getElementById("debate_G7"+old_debate_G7).style.display="none";
document.getElementById("debate_G7"+old_debate_G7+"#1").style.display="";
document.getElementById("debate_G7"+objid_G7+"#1").style.display="none";
document.getElementById("debate_G7"+objid_G7).style.display="";
document.getElementById("debate_content_G7"+old_debate_G7).style.display="none";
document.getElementById("debate_content_G7"+objid_G7).style.display="";
old_debate_G7=objid_G7;
}
var objid_G7 = 1;
var interval_best;
function best_changeG7()
{
if( objid_G7 == <?=count($list)?> ) // 드렁크수달수님 팁
objid_G7 = 1;
else
objid_G7++;
ComeonG7(objid_G7);
}
function setInterval_best()
{
interval_best = setInterval("best_changeG7()",5000);//속도조절
}
function clearInterval_best()
{
clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
<style type="text/css">
.img { padding:5px; text-align:right; }
.maing { padding-top:15px; padding-bottom:15px; padding-left:20px; text-align:left; border-top:1px solid #e2e0d7; border-bottom:1px solid #e2e0d7;}
.maing2 { padding-top:15px; padding-bottom:15px; padding-left:20px; text-align:left; border-bottom:1px solid #e2e0d7;}
.maing3 { height:80px; padding-top:15px; padding-bottom:15px; padding-left:20px; text-align:left; }
.maing { font-family:돋움; font-size:16px; font-weight:bold; text-decoration:none; color:#c3827e; }
.maing2 { font-family:돋움; font-size:12px; text-decoration:none; color:#877a7e; line-height:25px;}
.maing3 { height:80px; line-height:19px; }
</style>
<!-- 타이틀 부분 -->
<table width="910" cellpadding="0" cellspacing="0" style="padding-bottom:8px;">
<tr><td align="left"><img src="/images/main_now_title.gif"></td>
<td class="img" align="right">
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
?>
<a href="<?=$list[$i][href]?>" onmouseover="javascript:ComeonG7('<?=$k?>')"><img src="<?=$latest_skin_path?>/img/<?=$k?>_on.gif" width="24" height="25" hspace="0" border="0" alt="<?=$list[$i][subject]?>" id="debate_G7<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo ""; } else { echo "style='DISPLAY: none;' "; } ?>><img src="<?=$latest_skin_path?>/img/<?=$k?>.gif" width="24" height="25" hspace="0" border="0" id="debate_G7<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none;'"; } else { echo ""; } ?>></a>
<?}?>
</td></tr></table>
<!-- 본문 시작 -->
<table width="910" height="435" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td height="435">
<? for ($i=0; $i<count($list); $i++) {
$j = $i + 1;
if ($j == "1") {
echo "<DIV>";
echo "<DIV id=debate_content_G7$j onmouseover=clearInterval_best() onmouseout=setInterval_best()>"; }
else { echo "<DIV id=debate_content_G7$j onmouseover=clearInterval_best() onmouseout=setInterval_best() style='DISPLAY: none;'>\n"; }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td width="546" height="435" style="border:4px solid #ffffff;" onMouseOver="this.style.border='4px solid #ed6d4a'" onMouseOut="this.style.border='4px solid #ffffff'">
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' ></a></td>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?>
<a href='<?=$list[$i][href]?>'><?=$thumfile?></a>
<td valign="top" align="right">
<table width="335" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td class=maing><?=$list[$i]['subject']?></td>
</tr>
<tr>
<td class=maing2>
<font color="#f26522">_</font> 전시기간 : <font color="#c3827e"><?=date("20y.m.d", strtotime($list[$i]['wr_1']));?> - <?=date("20y.m.d", strtotime($list[$i]['wr_2']));?></font><br> <font color="#f26522">_</font> 전시장소 : <font color="#c3827e"><?=$list[$i]['wr_3']?></font><br> <font color="#f26522">_</font> 작가명 : <font color="#c3827e"><?=$list[$i]['wr_4']?></font><br> <font color="#f26522">_</font> URL : <?=$list[$i]['wr_7']?>
</font>
</td>
</tr>
<tr>
<td class=maing3 ><font color="#f26522">_</font> <b>전시개요</b><br><br><?=cut_str($list[$i]['wr_5'],380) ?><a href="<?=$list[$i][href]?>">[더보기]</a></td>
</tr>
</table>
</td>
</tr>
</table>
<?
echo "</DIV>";
}
?>
</tr>
</table>
링크 사이트 보시면
메인에 최근이미지추출이 되어 있는데 우측 1.2.3.4 버튼에 롤오버나 onclick 시
해당 게시글 내용이 출력이 되는데 이미지에 페이드 효과를 주고 싶은데
어떻게 해야 할까요 ^^;
이미지가 너무 딱딱하게 나와서 페이드인 좀 줄려고 하는데 방법이...
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 546;
$img_height = 435;
$img_quality = 100;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_G7';
$ym = date("ym", $g4[server_time]);
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
//코멘트와 리플글은 제외
$sql = " select * from $tmp_write_table
where wr_comment = '' and wr_reply = ''
order by wr_id DESC LIMIT 0, 1 ";
$result = sql_query($sql);
$last_con = sql_fetch_array($result);
?>
<SCRIPT type=text/javascript>
<!--
old_debate_G7='1';
function ComeonG7(objid_G7){
document.getElementById("debate_G7"+old_debate_G7).style.display="none";
document.getElementById("debate_G7"+old_debate_G7+"#1").style.display="";
document.getElementById("debate_G7"+objid_G7+"#1").style.display="none";
document.getElementById("debate_G7"+objid_G7).style.display="";
document.getElementById("debate_content_G7"+old_debate_G7).style.display="none";
document.getElementById("debate_content_G7"+objid_G7).style.display="";
old_debate_G7=objid_G7;
}
var objid_G7 = 1;
var interval_best;
function best_changeG7()
{
if( objid_G7 == <?=count($list)?> ) // 드렁크수달수님 팁
objid_G7 = 1;
else
objid_G7++;
ComeonG7(objid_G7);
}
function setInterval_best()
{
interval_best = setInterval("best_changeG7()",5000);//속도조절
}
function clearInterval_best()
{
clearInterval(interval_best);
}
setInterval_best();
//-->
</SCRIPT>
<style type="text/css">
.img { padding:5px; text-align:right; }
.maing { padding-top:15px; padding-bottom:15px; padding-left:20px; text-align:left; border-top:1px solid #e2e0d7; border-bottom:1px solid #e2e0d7;}
.maing2 { padding-top:15px; padding-bottom:15px; padding-left:20px; text-align:left; border-bottom:1px solid #e2e0d7;}
.maing3 { height:80px; padding-top:15px; padding-bottom:15px; padding-left:20px; text-align:left; }
.maing { font-family:돋움; font-size:16px; font-weight:bold; text-decoration:none; color:#c3827e; }
.maing2 { font-family:돋움; font-size:12px; text-decoration:none; color:#877a7e; line-height:25px;}
.maing3 { height:80px; line-height:19px; }
</style>
<!-- 타이틀 부분 -->
<table width="910" cellpadding="0" cellspacing="0" style="padding-bottom:8px;">
<tr><td align="left"><img src="/images/main_now_title.gif"></td>
<td class="img" align="right">
<? for ($i=0; $i<count($list); $i++) {
$k = $i + 1;
?>
<a href="<?=$list[$i][href]?>" onmouseover="javascript:ComeonG7('<?=$k?>')"><img src="<?=$latest_skin_path?>/img/<?=$k?>_on.gif" width="24" height="25" hspace="0" border="0" alt="<?=$list[$i][subject]?>" id="debate_G7<?=$k?>" onmouseover="clearInterval_best()" onmouseout="setInterval_best()" <? if($k == "1") { echo ""; } else { echo "style='DISPLAY: none;' "; } ?>><img src="<?=$latest_skin_path?>/img/<?=$k?>.gif" width="24" height="25" hspace="0" border="0" id="debate_G7<?=$k?>#1" <? if($k == "1") { echo "style='DISPLAY: none;'"; } else { echo ""; } ?>></a>
<?}?>
</td></tr></table>
<!-- 본문 시작 -->
<table width="910" height="435" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td height="435">
<? for ($i=0; $i<count($list); $i++) {
$j = $i + 1;
if ($j == "1") {
echo "<DIV>";
echo "<DIV id=debate_content_G7$j onmouseover=clearInterval_best() onmouseout=setInterval_best()>"; }
else { echo "<DIV id=debate_content_G7$j onmouseover=clearInterval_best() onmouseout=setInterval_best() style='DISPLAY: none;'>\n"; }
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td width="546" height="435" style="border:4px solid #ffffff;" onMouseOver="this.style.border='4px solid #ed6d4a'" onMouseOut="this.style.border='4px solid #ffffff'">
<?
//썸네일 생성
$thumfile = "";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// 썸네일 이미지가 존재하지 않는다면
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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else { //게디터에서 삽입한 이미지 뽑자ㅠㅠ
$edit_img = $list[$i]['wr_content'];
if (eregi("data/cheditor4/{$ym}/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp)) { // data/geditor------
$file = './' . $tmp[0]; // 파일명
$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
break;
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' ></a></td>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?>
<a href='<?=$list[$i][href]?>'><?=$thumfile?></a>
<td valign="top" align="right">
<table width="335" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
<tr>
<td class=maing><?=$list[$i]['subject']?></td>
</tr>
<tr>
<td class=maing2>
<font color="#f26522">_</font> 전시기간 : <font color="#c3827e"><?=date("20y.m.d", strtotime($list[$i]['wr_1']));?> - <?=date("20y.m.d", strtotime($list[$i]['wr_2']));?></font><br> <font color="#f26522">_</font> 전시장소 : <font color="#c3827e"><?=$list[$i]['wr_3']?></font><br> <font color="#f26522">_</font> 작가명 : <font color="#c3827e"><?=$list[$i]['wr_4']?></font><br> <font color="#f26522">_</font> URL : <?=$list[$i]['wr_7']?>
</font>
</td>
</tr>
<tr>
<td class=maing3 ><font color="#f26522">_</font> <b>전시개요</b><br><br><?=cut_str($list[$i]['wr_5'],380) ?><a href="<?=$list[$i][href]?>">[더보기]</a></td>
</tr>
</table>
</td>
</tr>
</table>
<?
echo "</DIV>";
}
?>
</tr>
</table>
댓글 전체
124 라인에 그냥 display 부분만 보이고 안보이고 설정하는데
저안에서
식으로 작업 하면 될꺼같네요 이미지 만 하고싶으시면 jquery select 이용해서 $(엘리멘트 img) 식으로 하시면 댈듯한데요
function ComeonG7(objid_G7){
document.getElementById("debate_G7"+old_debate_G7).style.display="none";
document.getElementById("debate_G7"+old_debate_G7+"#1").style.display="";
document.getElementById("debate_G7"+objid_G7+"#1").style.display="none";
document.getElementById("debate_G7"+objid_G7).style.display="";
document.getElementById("debate_content_G7"+old_debate_G7).style.display="none";
document.getElementById("debate_content_G7"+objid_G7).style.display="";
old_debate_G7=objid_G7;
}
저안에서
$((숨겨질 엘리멘트).fadeOut('slow', function() {
$(보여줄 엘리먼트).fadeIn("slow");
})
식으로 작업 하면 될꺼같네요 이미지 만 하고싶으시면 jquery select 이용해서 $(엘리멘트 img) 식으로 하시면 댈듯한데요
아 대입법을 모르니 대충 끼어맞추는데 에러만 나네요.. ㅋㅋ이쪽은 약해서 ..
document.getElementById("debate_G7"+old_debate_G7).style.display="none";
=>
$(#+"debate_G7"+old_debate_G7).fadeOut('slow', function() {
$(#+"debate_G7"+objid_G7).fadeIn("slow");
})
그런데 "debate_G7"+objid_G7+"#1" 이런 아이디는 뭔지 모르겠네요 아이디가 이런식으로 써지는게 없을텐데..
=>
$(#+"debate_G7"+old_debate_G7).fadeOut('slow', function() {
$(#+"debate_G7"+objid_G7).fadeIn("slow");
})
그런데 "debate_G7"+objid_G7+"#1" 이런 아이디는 뭔지 모르겠네요 아이디가 이런식으로 써지는게 없을텐데..
GOO^^