갤러리 관련 질문입니다!!
본문
안녕하세요 초보 개발자입니다.
갤러리 스킨쪽에 fancybox 관련해서 막힌부분 질문올립니다.
해당 소스는
<li class="gall_href">
<?php
if ($list[$i]['is_notice']) { // 공지사항 ?>
<strong style="width:<?php echo $board['bo_gallery_width'] ?>px;height:<?php echo $board['bo_gallery_height'] ?>px">공지</strong>
<?php
} else {
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $imgmaxwidth, $imgmaxheight);
if($thumb['src']) {
$img_content = '<a class="fancybox" href="'.$thumb['src'].'" title="'.$list[$i]['subject'].'" data-view="#gall_content_'.$i.'"width="'.$imgmaxwidth.'" height="'.$imgmaxheight.'">
<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="img">
<!--<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'"width="'.$imgminwidth.'" height="'.$imgminheight.'">-->';
} else {
$img_content = '<span style="width:'.$board['bo_gallery_width'].'px;line-height:'.$board['bo_gallery_height'].'px" class="noimg">no image</span>';
}
echo $img_content;
}
?>
</a>
</li>
리스트에서 노란색이 썸네일 함수고 주황색이 img_content 인데요
문제는 리스트에서 썸네일로 보이는 이미지를 클릭해야 fancybox 가 떠서 img_content 에 저장된것들 보여주는대
저는 썸네일 이미지를 통해서가 아닌 버튼을 누르면 fancybox 가 뜨게끔 하고싶습니다.
보통은 a href 로 경로만 지정해주면 되는대 이거는 썸네일 함수와 $img_content 안에 있어서
경로수정을 어떻게 해줘야 될지 모르겠습니다..
혹시 해당내용 아시는분 계신다면 도움좀 부탁드리겠습니다!
답변 1
$img_content = '<a class="fancybox" href="'.$thumb['src'].'" title="'.$list[$i]['subject'].'" data-view="#gall_content_'.$i.'"width="'.$imgmaxwidth.'" height="'.$imgmaxheight.'">
<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="img">
위의 소스 코드를 아래와 같이 변경해 보세요.
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'" class="img">
<a class="fancybox" href="'.$thumb['src'].'" title="'.$list[$i]['subject'].'" data-view="#gall_content_'.$i.'"width="'.$imgmaxwidth.'" height="'.$imgmaxheight.'">버튼이미지';
우선 버튼이미지 위치에 원하는 버튼 이미지를 넣어서 테스트 하시고
확인후 버튼이미지 경로 소스를 넣어 주시면 될 것같네요.
!-->!-->