b

균이님, 해피정님의 갤러리 소스 인데요, 다단 섬네일 관련 재질문입니다.

va332.jpg
s.jpg
현재는 섬네일이 보여질 섬네일 숫자보다 늘어나면 좌우로 화살표가 생기고 직접 넘기는

방식입니다만 이걸 아래 이미지처럼 다단으로 늘리고 싶습니다. 아래는 주요 소스구요.

어려운 내용일까요?







<table align="left" cellpadding="0" cellspacing="1" border="0">
<tr>
<?php if($thumbNum>$thumbViewNum) { ?>
<td width='40' class='thumbpre_next' onmousedown="thumbpre_view(1)" onmouseover="this.className='thumbBtnOver';" onmouseout="this.className='thumbpre_next';" align='center'>〈 </td>
<?php } ?>
<td align='left'>
<?php if($thumbNum>$thumbViewNum){ ?>
<div style='position:relative;overflow:hidden;width:<?php echo $thumb_div_width; ?>; height:<?php echo ($thumby+10); ?>px;' id='thumDivk'>
<div style='position:absolute;top:0; left:0; text-align:left;' id='thumDivk2'>
<?php } ?>

<table align="left" cellpadding="0" cellspacing="5" border="0">
<tr>
<?php $h=-1;
for($i=0;$i<$view[file][count]; $i++){
if(!$view[file][$i][view]){$thumbNum--; continue; }

$thum_img="$imgPath/thumbs/{$view[wr_id]}_{$i}.jpg";
$h++;

//큰 이미지 리사이즈
if($resizex && $resizey && ($view[file][$i][image_width]>$resizex || $view[file][$i][image_height]>$resizey) ){
$ret_wh= image_resizetg($view[file][$i][file], $resizex, $resizey, $bo_table, $view[wr_id], $i);
if($ret_wh[0] && $ret_wh[1]){
$view[file][$h][image_width]=$ret_wh[0]; $view[file][$h][image_height]=$ret_wh[1];
}
}
//썸네일 만들기
if(!file_exists($thum_img))
tg_thumb($view[file][$i][file], $thumbx, $thumby, $bo_table, $view[wr_id], $i );
?>
<td class='thumb' align='left' onmouseover="over_cell(<?php echo $h; ?>, this)" onmouseout="out_cell(<?php echo $h; ?>,this)" onmousedown="view_image(<?php echo $h; ?>)" id="thumTD<?php echo $h; ?>"><img src="<?php echo $thum_img; ?>" ></td>
<?php
}
?>
</tr>
</table>

<?php if($thumbNum>$thumbViewNum) { ?>
</div>
</div>
<?php } ?>

</td>
<?php if($thumbNum>$thumbViewNum) { ?>
<td width='40' class='thumbpre_next' onmousedown="thumbpre_view(2)" onmouseover="this.className='thumbBtnOver';" onmouseout="this.className='thumbpre_next';" align='center'> 〉 </td>
<?php } ?>
</tr>
</table>

첨부파일

va332.jpg (117.8 KB)
2회 2013-06-10 15:34
s.jpg (170.4 KB)
0회 2013-06-10 15:34
|

댓글 1개

위 소스에서 다음코드 부분만 수정하고 위쪽, 아래쪽 모두 지워버리세요
style 추가
.thumb{ float:left; padding:2px; border:1px solid blue;}
.blank{clear:both;height:10px;}

위쪽 삭제
<?php $h=-1;
~~중략

//썸네일 만들기
if(!file_exists($thum_img))
tg_thumb($view[file][$i][file], $thumbx, $thumby, $bo_table, $view[wr_id], $i );
if($i && $i % 4==0) echo "<div class='blank'><!-- --></div>";
?>
<div class='thumb' onmouseover="over_cell(<?php echo $h; ?>, this)" onmouseout="out_cell(<?php echo $h; ?>,this)" onmousedown="view_image(<?php echo $h; ?>)" id="thumTD<?php echo $h; ?>"><img src="<?php echo $thum_img; ?>" ></div>

<?php } ?>
아래쪽 삭제

대충이렇게 되는데 사이즈, 위치 등은 조절하면 되겟지요
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
13-06-10 조회 962
13-06-10 조회 1,087
13-06-10 조회 1,783
13-06-10 조회 936
13-06-10 조회 1,885
13-06-10 조회 2,118
13-06-10 조회 1,087
13-06-10 조회 906
13-06-10 조회 1,764
13-06-10 조회 1,673
13-06-10 조회 1,646
13-06-10 조회 1,661
13-06-10 조회 1,650
13-06-10 조회 2,325
13-06-10 조회 1,693
13-06-10 조회 1,372
13-06-10 조회 1,521
13-06-10 조회 1,127
13-06-10 조회 991
13-06-10 조회 905