최신글 slick슬라이드를 활용한 게시판 문의드립니다ㅠㅠ..

최신글 slick슬라이드를 활용한 게시판 문의드립니다ㅠㅠ..

QA

최신글 slick슬라이드를 활용한 게시판 문의드립니다ㅠㅠ..

본문

어떤개발자님께서 올려주신 소스를 다운받아 활용을했습니다.

근데 중간중간이 비어져있는상태로 롤링이됩니다.ㅠㅠ

도와주세요.. 고수님들 ㅠㅠ..

 

<현재 제작중인 페이지 url>

https://hsport1.cafe24.com/theme/design/preview.php?name=index2

 

 

<슬라이드불러오는 php페이지>

 


<div class="rolling">
    <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>
    <div class="variable slider center">
        <?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'].'" >';
        ?>
        <div>
            <a href="<?php echo $list[$i]['href'] ?>" class="lt_img"><?php echo $img_content; ?></a>
            <div class="gall_content">
                <?php
                    //if ($list[$i]['icon_secret']) echo "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> ";
                    //if ($list[$i]['icon_new']) echo "<span class=\"new_icon\">N<span class=\"sound_only\">새글</span></span>";
                    //if ($list[$i]['icon_hot']) echo "<span class=\"hot_icon\">H<span class=\"sound_only\">인기글</span></span>";
         
                    echo "<a href=\"".$list[$i]['href']."\"> ";
                    if ($list[$i]['is_notice'])
                        echo "<strong>".$list[$i]['subject']."</strong>";
                    else
                        echo $list[$i]['subject'];
                
                    // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
                    // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
                     //echo $list[$i]['icon_reply']." ";
                   // if ($list[$i]['icon_file']) echo " <i class=\"fa fa-download\" aria-hidden=\"true\"></i>" ;
                    //if ($list[$i]['icon_link']) echo " <i class=\"fa fa-link\" aria-hidden=\"true\"></i>" ;
                    if ($list[$i]['comment_cnt'])  echo "
                    <span class=\"lt_cmt\">+ ".$list[$i]['wr_comment']."</span>";
                    ?>
                <div class="box-content">
                    <?php echo $list[$i]['wr_content'];?>
                    <!--<?php $list[$i][wr_content] = cut_str($list[$i][wr_content], 70, ".."); echo $list[$i]['wr_content'] ?>-->
                </div>
            </div>
            <!--<span class="lt_date"><?php echo $list[$i]['datetime2'] ?></span>-->
        </div>
        <?php }  ?>
        <?php if (count($list) == 0) { //게시물이 없을 때  ?>
        <li class="empty_li">게시물이 없습니다.</li>
        <?php }  ?>

    </div>
</div>
<script type="text/javascript">
    $(document).on('ready', function() {
        $('.center').slick({
            centerMode: true,
            centerPadding: '0px',
            slidesToShow: 5,
            infinite: true,
            /* 자동으로 다음이미지 보여주기 */
            dots: true, //페이징
            infinite: true,
            arrows: true,
            slidesToScroll: 1,
            autoplay: false,
            autoplaySpeed: 2000,
            /* 화살표 */
            responsive: [{
                    breakpoint: 768,
                    settings: {
                        arrows: false,
                        centerMode: true,
                        centerPadding: '40px',
                        slidesToShow: 3
                    }
                },
                {
                    breakpoint: 480,
                    settings: {
                        arrows: false,
                        centerMode: true,
                        centerPadding: '40px',
                        slidesToShow: 1
                    }
                }
            ]
        });
    });
</script>

이 질문에 댓글 쓰기 :

답변 1

위의 코드중 자바스크립트 부분(slick세팅 부분)을

 

https://codepen.io/swetankrathi/pen/OyRZxL

 

에 카피해 보니,  제대로 동작되는 것 같습니다.

 

CSS 부분 세팅이 잘못되어 있을 수도 있을 것 같기도 합니다.

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

회원로그인

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