최신글 hover 관련 문의입니다!

최신글 hover 관련 문의입니다!

QA

최신글 hover 관련 문의입니다!

본문


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
 
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 0);
$thumb_width = 404;
$thumb_height = 418;
?>
 
<div class="pic_lt">
    <!-- <h2 class="lat_title"><a href="<?php echo G5_BBS_URL ?>/board.php?bo_table=<?php echo $bo_table ?>"><?php echo $bo_subject ?></a></h2> -->
    <ul>
    <?php
    for ($i=0; $i<count($list); $i++) {
    $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
 
    if($thumb['src']) {
        $img = $thumb['src'];
    } else {
        $img = G5_IMG_URL.'/no_img.png';
        $thumb['alt'] = '이미지가 없습니다.';
    }
    $img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
    ?>
        <li class="col-xs-12 col-sm-6 col-md-3">
            <div class="main-gallery-li-wrap" onclick="location.href='<?php echo $list[$i]['href'] ?>'">
                <a href="<?php echo $list[$i]['href'] ?>" class="lt_img"><?php echo $img_content; ?></a>
                <?php

 
    
                echo "
                <div class='main-gallery-hv-bg' onclick="location.href='<?php echo $list[$i]['href'] ?>'"></div>
                <div class='main-gallery-hv'>
                <a class='main-gallery-subject' href=\"".$list[$i]['href']."\"> 
                <p><i class='fa fa-plus' aria-hidden='true'></i><p>
                ";
                if ($list[$i]['is_notice'])
                    echo "<strong>".$list[$i]['subject']."</strong>";
                else
                    echo $list[$i]['subject'];

 
                echo "</a></div>";

 
                if ($list[$i]['comment_cnt'])  echo "
                <span class=\"lt_cmt\">+ ".$list[$i]['wr_comment']."</span>";
 
                ?>
 
                </div>
        </li>
    <?php }  ?>
    <?php if (count($list) == 0) { //게시물이 없을 때  ?>
    <li class="empty_li">게시물이 없습니다.</li>
    <?php }  ?>
    </ul>

 
</div>
 

 

 

이 중에서!

 

<div class='main-gallery-hv-bg' onclick="location.href='<?php echo $list[$i]['href'] ?>'"></div>

 

이 부분을 사용하고싶습니다.

호버를하면 백그라운드가 올라오는데.. 그러면 최신글 이미지 자체에 달려있던 링크효과가 사라져서, 백그라운드에도 링크를 달고싶은데요.. 아무래도 php는 모른채로 복붙만 하다보니 이렇게 되는거같습니다 ㅠㅠ 도와주세요!

 

 

 

 

이 질문에 댓글 쓰기 :

답변 1

                echo "
                <div class='main-gallery-hv-bg' onclick="location.href='<?php echo $list[$i]['href'] ?>'"></div>
                <div class='main-gallery-hv' onclick="location.href='<?php echo $list[$i]['href'] ?>'">
                <a class='main-gallery-subject' href=\"".$list[$i]['href']."\"> 
                <p><i class='fa fa-plus' aria-hidden='true'></i><p>
                ";

자세한 css를 몰라서..  저렇게 하면 링크가 걸릴것 같은데용

답변을 작성하시기 전에 로그인 해주세요.
전체 192
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT