자바스크립트 마우스오버가 동작하지 않습니다
관련링크
본문
이미지에 마우스를 올리면 썸네일이 변경되게끔 하는 스크립트인데 에디터 코드 수정 후부터 작동하지 않습니다 어떤게 문제인지 검토해주실 수 있을까요?
$(document).ready(function(){
//변수설정
var trigger = $("ul.minThumb li a"),
thumb = $(".photo img");
//기본설정
thumb.first().addClass("current");
//이벤트 설정
trigger.each(function(){
$(this).bind("mouseenter focusin", function(){
$(this).parent().parent().siblings(".photo").find("img").attr("src", $(this).find("img").attr("src").replace("118x90","590x380")); //작은썸네일 크기, 큰 썸네일 크기 순으로 상황에 맞게 수정
$(this).parent().parent().siblings(".photo").find("img").attr("alt", $(this).find("img").attr("alt"));
});
});
});
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// 게시글보기 썸네일 생성
function get_thumbnail($bo_table, $img, $width, $height=0, $alt, $view=0)
{
$str = '';
$file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$img;
if(is_file($file))
$size = @getimagesize($file);
if($size[2] < 1 || $size[2] > 3)
return '';
$img_width = $size[0];
$img_height = $size[1];
$filename = basename($file);
$filepath = dirname($file);
if($img_width && !$height) {
$height = round(($width * $img_height) / $img_width);
}
$thumb = thumbnail($filename, $filepath, $filepath, $width, $height, false, false, 'center', true, $um_value='80/0.5/3');
if($thumb) {
$file_url = str_replace(G5_PATH, G5_URL, $filepath.'/'.$thumb);
$str = '<img src="'.$file_url.'" width="'.$width.'" height="'.$height.'" alt="'.$alt.'">';
}
if($view == 1) return $str;
}
?>
<script src="<?php echo $board_skin_url; ?>/script.js"></script>
<link rel="stylesheet" href="<?php echo $board_skin_url; ?>/style.css">
<div class="mara_view_wrap" style="width:<?php echo $width; ?>;">
<h1 class="subject">
<?php echo cut_hangul_last(get_text($view['wr_subject'])); ?>
</h1>
<div class="thumb">
<div class="photo"><?php if($view['file']['0']['file']){ ?><?php echo get_thumbnail($bo_table, $view['file'][0]['file'], 590, 380, $view['file'][0]['bf_content'], 1); ?><?php } ?></div>
<ul class="minThumb">
<?php for($i = 0; $i <= count($view['file']); $i++) { // 객실 이미지 뷰 ?>
<?php if($view['file'][$i]['file']){
get_thumbnail($bo_table, $view['file'][$i]['file'], 590, 380, $view['file'][$i]['bf_content']);
?>
<li><a href="<?php echo $view['file'][$i]['path'] . '/' . $view['file'][$i]['file']; ?>" target="_blank"><?php echo get_thumbnail($bo_table, $view['file'][$i]['file'], 118, 90, $view['file'][$i]['bf_content'], 1); ?></a></li>
<?php } ?>
<?php } ?>
</ul>
</div>
!-->!-->
답변을 작성하시기 전에 로그인 해주세요.