그림이 바뀌면 제목도 함께 불러오는 방법을 알고 싶습니다.

그림이 바뀌면 제목도 함께 불러오는 방법을 알고 싶습니다.

QA

그림이 바뀌면 제목도 함께 불러오는 방법을 알고 싶습니다.

본문

moteltour_co_kr_20140221_150013.jpg
 
작은 섬네일 이미지를 누르면 큰 섬네일 이미지가 바뀝니다.
이때 큰 섬네일 아래쪽에 제목도 불러오고 싶습니다.
(그림이 바뀌면 제목도 함께 바뀝니다.)
어떻게 해야 하나요?

이 질문에 댓글 쓰기 :

답변 2

<div style='position:absolute;z-index:10;width:750px;height:30px;background-color:#000;text-align:left;margin-top:470px;line-height:30px;'><span style="padding-left:10px;">".$list[$i][wr_subject]."</span></div>
<a href='<?=$list[$i][href]?>'><img src="<?=$thumfile2?>" width=750px; height="500" alt="" /></a>
 
이렇게 해보세요........안되면 저도 테스트해보면서 해봐야
우선 바뀌는 소스를 올려주시던가.. 아니면 해당 주소를 보여주셔야 답을 할수 있을거 같아요~

<div>

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$img_width = 750; //큰 썸네일 가로
$img_height = 500; //큰 썸네일 세로
$img_quality = 100; //썸네일 퀄리티

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_big4';
$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" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script type="text/javascript" src="http://malsup.github.com/chili-1.7.pack.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
<script type="text/javascript" src="http://malsup.github.com/jquery.easing.1.3.js"></script>
<script type="text/javascript">
$(function() {
    $('#slideshow').cycle({
        fx:    'fade',
        speed:  '2500',
pause:  1 ,
        timeout: 3000,
        pager:  '#nav',
pagerEvent: 'mouseover',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav li:eq(' + (idx) + ') a';
        }
    });

    $('#direct').click(function() {
        $('#nav li:eq(2) a').triggerHandler('click');
        return false;
    });
   
});

</script>
<style type="text/css">
* {margin:0}
img {border:none}
#slideshow {}
#nav_wrap {width:750px; text-align:center;}
#nav {
}
#nav li {float:left; border:1px solid #ccc; margin:5px; padding:5px; list-style:none;}
#nav a {padding:2px; display:block;}
#nav li.activeSlide a {background:#50a0fa; }
#nav a:focus {outline:none; }
#nav img {border:none; display:block;}
</style>

<div id="slideshow">
<!-- First Content -->
<?
for ($i=0; $i<count($list); $i++) {
$thumfile2 = $thumb_path.'/'.$list[$i][wr_id];

$j = $i + 1; 
if ($j == "1") {
$hide='';
} else {
$hide='ui-tabs-hide'; }
?>

<a href='<?=$list[$i][href]?>'><img src="<?=$thumfile2?>" width=750px; height="500" alt="" /></a>
 
 <? }?> 

</div>

<div id="nav_wrap">
<ul id="nav" class="clearfix">
<?
for ($i=0; $i<count($list); $i++) {
$j = $i + 1; 
if ($j == "1") {
$selected='ui-tabs-selected';
} else {
$selected='';}
//썸네일 생성
$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 = "$thumb";
else
//이미지가 없으면
$thumfile="$latest_skin_path/img/noimg.gif";
//이미지가 아니네
        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>"; }
?>
    <li class="ui-tabs-nav-item <?=$selected?>" id="nav-fragment-<?=$j?>"><a href="#fragment-<?=$j?>"><img src="<?=$thumfile?>" alt="" width="80" height="80" ></a></li>
<? }?>
</ul>
</div>
</div>

답변을 작성하시기 전에 로그인 해주세요.
전체 17
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT