테스트 사이트 - 개발 중인 베타 버전입니다

마우스 오버시 상품 이미지 흐릿 하게 하기

· 15년 전 · 554 · 4

이것저것 찾아보다가 결국 혼자 해결 했습니다;;

비슷한 예제도 있긴한데 이게 제일 간편하게 적용 가능 할 듯 하네요.

shop.lib.php 부분의 '//이미지를 얻는다' 부분을 통째로 바꾸시면 됩니다 실제로는 두줄 추가한거지만
이래저래 찾기 귀찮으신 분들을 위해 ^^

// 이미지를 얻는다
function get_image($img, $width=0, $height=0)
{
 global $g4, $default;

    $full_img = "$g4[path]/data/item/$img";

    if (file_exists($full_img) && $img)
    {
        if (!$width)
        {
            $size = getimagesize($full_img);
            $width = $size[0];
            $height = $size[1];
        }
        $str = "<img id='$img' src='$g4[url]/data/item/$img' width='$width' height='$height' border='0'";
        $str .= "style=\"FILTER: alpha(opacity=100)\" onmouseover=\"this.style.filter = 'alpha(opacity=80)';\" onmouseout=\"this.style.filter='none'\">";
    }
    else
    {
        $str = "<img id='$img' src='$g4[shop_img_url]/no_image.gif' border='0' ";
        if ($width)
            $str .= "width='$width' height='$height'";
        else
            $str .= "width='$default[de_mimg_width]' height='$default[de_mimg_height]'";
        $str .= "style=\"FILTER: alpha(opacity=100)\" onmouseover=\"this.style.filter = 'alpha(opacity=90)';\" onmouseout=\"this.style.filter='none'\">";
    }


    return $str;
}


댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 4개

감사합니다^^
필요했던것인데 감사합니다.^^
qq
적용하니까 오늘본상품이 안나오네요 ㅋ 왜그런걸까요?????

게시글 목록

번호 제목
1111
1107
1105
1102
1099
1098
1097
1101
1096
1132
1094
1092
1091
1088
1087
1083
1082
1076
1068
1056