작은사진에 마우스가져가면 큰 사진으로 표현
본문
게시판을 수정중에 있는데요.
게시판 view 코드인데요.
여기에서
사진들을 불러오는데요.
문제가 생겼습니다.
작은 사진에 마우스를 가져가면 큰사진이 표시되어야 하는데요.
왜 안되는지 모르겠네요...ㅡㅡ;
기존 코드에서 되었는데요..ㅡㅡ
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(G5_IS_MOBILE) {
$view_tr = '</tr><tr>';
$view_align = 'left';
$view_css_head = 'm-';
$daum_view = daum_view($wr_post['daum_view'],'m');
$view['date'] = amina_date($view['wr_datetime']);
} else{
$view_tr = '';
$view_align = 'right';
$view_css_head = '';
$daum_view = daum_view($wr_post['daum_view'],'l');
$view['date'] = '<span class="cnt">'.$view['date'].'</span>';
}
//링크 & 첨부
$attach_list = '';
if(!$is_admin && $view['blind']) {
;
} else {
//링크
for ($i=1; $i <= G5_LINK_COUNT; $i++) {
if ($view['link'][$i]) {
$link = cut_str($view['link'][$i], 70);
$attach_list .= '<li>관련링크 - <a href="'.$view['link_href'][$i].'" target="_blank">'.$link.' <span class="cnt">['.$view['link_hit'][$i].']</span></a></li>'."\n";
}
}
//첨부
for ($i=0; $i < count($view['attach']['file']); $i++) {
$attach_list .= "<li>첨부파일 - <a href=\"javascript:file_download('{$view['attach']['file'][$i]['href']}&js=on', '{$view['attach']['file'][$i]['source']}');\" title=\"{$view['attach']['file'][$i]['content']}\">{$view['attach']['file'][$i]['source']} ({$view['attach']['file'][$i]['size']}) <span class=\"cnt\">[{$view['attach']['file'][$i]['download']}]</span></a></li>\n";
}
//다운제한
if($i > 0 && $v_icon['po_wr_type']) {
switch($v_icon['po_wr_type']) {
case 'both' : $po_wr_msg = '연동글에 열람/다운'.AS_MP.'를 사용한 회원만 다운로드할 수 있습니다.'; break;
case 'view' : $po_wr_msg = '연동글에 열람'.AS_MP.'를 사용한 회원만 다운로드할 수 있습니다.'; break;
case 'down' : $po_wr_msg = '연동글에 다운'.AS_MP.'를 사용한 회원만 다운로드할 수 있습니다.'; break;
default : $po_wr_msg = ''; break;
}
if($po_wr_msg) $attach_list .= '<li class="msg-po-down">이용안내 - '.$po_wr_msg.'</li>'."\n";
}
//다운
if($view['use_po_down']) $attach_list .= '<li class="msg-po-down">다운안내 - '.$view['msg_po_down'].'</li>'."\n";
//열람
if($view['use_po_view'] == "free" || $view['use_po_view'] == "ing") $attach_list .= '<li class="msg-po-view">열람안내 - '.$view['msg_po_view'].'</li>'."\n";
//채택
if($view['choice'] == "none") $attach_list .= '<li class="msg-choice">'.$amina['cmt_choice_txt'].'안내 - '.$amina['cmt_choice_txt'].'된 댓글은 <b>'.number_format($v_icon['choice_point']).''.AS_MP.'</b> 드립니다.</li>'."\n";
//기간
if($v_icon['ev_startdate'] && $v_icon['ev_enddate']) $attach_list .= '<li>기간안내 - '.amina_ev_date($bo_table, $wr_id, $view['wr_5'], 'Y.m.d', '종료되었습니다.').'</li>'."\n";
}
//헤드스킨
if(!$set['view_head']) {
include($head_skin_path.'/head.skin.php');
}
//헤드여백
if(!$set['view_head_line'] || $frame) echo '<div class="view-head-line"> </div>';
?>
<script type="text/javascript">
$(function(){
$("#imgList li>img").hover(function(){
$("#mainImg img").attr('src', $(this).attr('src'));
});
});
</script>
<style type="text/css">
img {border:0; }
.field { border:1px solid #ccc; }
#map_bg {
width: <?=$map_width?>;
margin: 0 5px 0 0;
border: 3px solid #f1f1f1;
}
#map_map {
border: 2px solid #dedede;
}
</style>
<div class="view-head-wrap">
<?php if($view['mb_photo']) { ?>
<div class="<?php echo $view_css_head;?>emo"><?php echo $view['mb_photo']; ?></div>
<?php } ?>
<div class="view-head">
<h1 id="bo_v_title" class="<?php echo $view_css_head; ?>view-subject">
<?php if(!$set['hide_view_icon']) echo $view['fa_icon']; ?><?php echo $view['subject']; ?> <?php if($view['icon_mobile']) { ?> <span class="view-mobile-icon"><?php echo $view['icon_mobile']; ?></span><?php } ?>
</h1>
<section id="bo_v_info">
<ul class="<?php echo $view_css_head; ?>view-info">
<?php if(!$set['hide_view_name']) { ?>
<li class="name"><?php echo $view['icon_level'].' '.$view['name'];?><?php if ($is_ip_view) { echo " ($ip)"; } ?></li>
<?php } ?>
<?php if($board['bo_use_nogood'] && !$set['hide_view_nogood']) { ?>
<li><span class="sound_only">비추천 </span><span class="nogood-icon"><?php echo $view['wr_nogood'];?></span></li>
<?php } ?>
<?php if($board['bo_use_good'] && !$set['hide_view_good']) { ?>
<li><span class="sound_only">추천 </span><span class="good-icon"><?php echo $view['wr_good'];?></span></li>
<?php } ?>
<li>조회 <span class="cnt"><?php echo $view['wr_hit']; ?></span></li>
<?php if(!$set['hide_view_star'] && $amina['star']) { ?>
<li><?php echo amina_star_mark($amina['star_color'],$view['wr_7'],'s');?></li>
<?php } ?>
<?php if(!$set['hide_view_cate'] && $view['ca_name']) { ?>
<li><?php echo $view['ca_name']; ?></li>
<?php } ?>
<li class="last"><?php echo $view['date']; ?></li>
</ul>
</section>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<?php if($attach_list) { //첨부 ?>
<section id="bo_v_file">
<ul class="view-attach">
<?php echo $attach_list; ?>
</ul>
</section>
<?php } ?>
<article id="bo_v_atc">
<?php echo $view['attach_skin']; ?>
<?php echo $view['related_skin']; ?>
<?php echo $view['poll_up']; ?>
<div class="view-content<?php echo (G5_IS_MOBILE) ? ' m-view-content' : '';?>">
<?
// 파일 출력
$sql = "select * from $g4[board_file_table] where `bo_table`='$bo_table' and `wr_id`='$wr_id'";
$result=mysql_query($sql);
for($i=0 ; $row = mysql_fetch_array($result) ; $i++){
//echo "<img src =$g4[path]/data/file/$bo_table/$row[bf_file] width=350 height=250 border=0 $style>";
$thumimg2[$i]="<img src =$g4[path]/data/file/$bo_table/$row[bf_file] width=350 height=250 border=0>";
$thumimg[$i]="<img src =$g4[path]/data/file/$bo_table/$row[bf_file] width=140 height=140 border=0>";
}
?>
<style>
.viewTable{border-collapse:collapse; width:100%;margin-top:10px;padding:0;}
#mainImg{text-align:center;padding-top:5px;}
#mainImg img{width:400px;height:200px;}
#imgList{list-style:none; padding:0;*zoom:1;margin:8px 5px 5px;}
#imgList:after{content:""; display:block; clear:both;}
#imgList li{float:left;padding:0px;margin:0px;}
#imgList li img{width:65px;height:40px;}
.viewInfo{border-collapse:collapse; border-top:1px solid #ddd;border-bottom:1px solid #ddd;width:100%;}
.viewInfo th, .viewInfo td{font-size:12px;padding:11px 8px 10px 18px;text-align:left;border-bottom:1px solid #ededed;}
.viewInfo th{background:url("<?=$board_skin_path?>/img/map_icon.gif") 4px 12px no-repeat;}
</style>
<table class="viewTable">
<colgroup>
<col width='250px' />
<col width='10px' />
<col />
</colgroup>
<tr>
<td style='border:1px solid #ddd;'>
<div id="mainImg"><img src='<?=$view['file'][0][path].'/'.$view['file'][0]['file']?>' /></div>
<?php
if($view['file'][count])
{
echo "<ul id='imgList'>";
for($i=0; $i<$view['file']['count'];$i++)
{
if($view['file'][$i]['view'])
echo "<li><img src='{$view['file'][$i][path]}/{$view['file'][$i][file]}' /></li>";
}
echo "</ul>";
}
?>
</td>
<td></td>
<td valign='top'>
<table class='viewInfo'>
<!--<tr>
<th width='20%;'>업종</th>
<td width='80%;'><?=$view['ca_name']?></td>
</tr>-->
<tr>
<th width="194">업 소 명</th>
<td width="276"><?=$view['wr_subject']?></td>
<th width="122">담당자</th>
<td width="365"><?=$view['wr_4']?></td>
</tr>
<tr>
<th width="194">업소종류</th>
<td width="276"><?=$view['wr_1']?></td>
<th width="122">예약 문의</th>
<td width="365"><?=$view['wr_2']?>
<a href="javascript:win_memo('../bbs/memo_form.php?me_recv_mb_id=<?php echo $view["mb_id"]?>');">
<img src='/skin/board/store/img/pay.jpg' align='absmiddle'></a>
</td>
</tr>
<tr>
<th>위 치</th>
<td colspan="3"><?=$view['wr_3']?> </td>
</tr>
<tr>
<th colspan="2">영업시간 및 휴무일</th>
<td colspan="4"><?=$view['wr_5']?></td>
</tr>
<tr>
<td colspan="4" bgcolor="#E8E8E8"><center>
<strong>이벤트 및 알림글 </strong>
</center></td>
</tr>
<tr>
<td style="height:80px" colspan="4" ><?php echo latest1("sztime_autotab","one",3,100,$view[mb_id]); //한줄소식 ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php echo $view['content']; ?>
<div class="clear"></div>
</div>
<?php if($view['lucky_point']) { ?>
<p class="view-lucky">
<i class="fa fa-gift fa-lg"></i> Congratulation! You win the <span class="view-lucky-point"><?php echo number_format($view['lucky_point']);?></span> Lucky <?php echo AS_MP;?>!
</p>
<?php } ?>
<?php echo $view['poll_down']; ?>
<?php echo $view['star_skin']; ?>
<?php echo $daum_view; ?>
<?php echo $view['good_skin']; ?>
<?php echo $view['sign_skin']; ?>
<?php if($view['ccl']) { ?>
<div class="view-ccl">
<img src="<?php echo AMINA_URL;?>/img/<?php echo $view['ccl_icon']; ?>" alt="" />
본 게시물은 <a href="<?php echo $view['ccl_deed']; ?>" target="_blank">크리에이티브 커먼즈 <?php echo $view['ccl']; ?> 2.0 대한민국 라이선스</a>에 따라 이용할 수 있습니다.
</div>
<?php } ?>
<?php if($view['tag']) { ?>
<div class="view-tag">
<img src="<?php echo AMINA_URL; ?>/img/icon_tag.gif" alt="" /> <?php echo $view['tag']; ?>
</div>
<?php } ?>
<?php echo $view['tag_skin'];?>
<table border=0 class="view-opt-tbl">
<tr>
<td valign="bottom">
<ul class="view-opt">
<li><a href="<?php echo $print_href; ?>" class="popup_print"><img src="<?php echo AMINA_URL; ?>/img/view_print.png" border=0 alt="" /><span>인쇄</span></a></li>
<?php if($scrap_href) { ?>
<li><a href="javascript:win_scrap('<?php echo $scrap_href; ?>');"><img src="<?php echo AMINA_URL; ?>/img/view_scrap.png" border=0 alt="" /><span>스크랩</span></a></li>
<?php } ?>
<li><a href="javascript:clipboard_address('<?php echo $address_url; ?>');"><img src="<?php echo AMINA_URL; ?>/img/view_url.png" border=0 alt="" /><span>주소</span></a></li>
<?php if($trackback_url) { ?>
<li><a href="javascript:trackback_send_server('<?php echo $trackback_url; ?>');"><img src="<?php echo AMINA_URL; ?>/img/view_tb.png" border=0 alt="" /><span>트랙백</span></a></li>
<?php } ?>
<?php if($shingo_href) { ?>
<li><a href="<?php echo $shingo_href; ?>"><img src="<?php echo AMINA_URL; ?>/img/view_shingo.png" border=0 alt="" /><span>신고</span></a></li>
<?php } ?>
</ul>
</td>
<?php echo $view_tr; ?>
<td valign="bottom" align="<?php echo $view_align; ?>">
<?php if($view['icon_sns']) { ?>
<div class="view-sns"><?php echo $view['icon_sns']; ?></div>
<?php } ?>
</td>
</tr>
</table>
<?php if($view['like_skin']) { ?>
<div class="view-like"><?php echo $view['like_skin']; ?></div>
<?php } ?>
</article>
답변 1
길다....
무조건 안된다 말고 어떻게 안되는지도 적어주세요
스크립트문제인지 스크립트 경로를 잘못탔는지 이미지 경로문제인지...
이런걸 알수있게 증상을 말해주시면 좋죠~
그리고 여기에 알럿하나 띄어보세요. 펑션 실행은 되는지
<script type="text/javascript">
$(function(){
$("#imgList li>img").hover(function(){
alert("실행은되니?");
$("#mainImg img").attr('src', $(this).attr('src'));
});
});
</script>
!-->
답변을 작성하시기 전에 로그인 해주세요.