이전 목록 다음
채택완료

위토즈님 모바일 빌더 메인 배너 반복 문제

2019-03-24 (일) 19:30:24 4,056

예전에 그누보드 4로 만든 업체가 모바일 페이지가 필요하다고 해서 위토즈님 빌더를 이용해서 사이트를 만들었는데요, 메인 배너가 한번 슬라이드 되고 반복이 안되네요...

스크립트에 loop: true, 를 넣어봤는데도 안되는거 보니 그거만 추가해서는 안되는거 같아 도움을 얻고자 질문 드립니다.

어떻게 하면 슬라이드가 반복되게 할수 있을까요?

Copy
<?php
$result = sql_query(" select * from {$g4['wz_banner_table']} where bo_clf = 'm_index' and bo_use = '1' order by bo_sort asc, bo_id desc ");

if (mysql_num_rows($result)) {  
?>

<div id="main_banner" class="swipebox">
    <div id="main_banner_wrap" class="swipe">
        <div class="swipe-wrap">

            <?php
            $max_width = $max_height = 0;
            $bn_first_class = '';

            for ($i=0; $row=sql_fetch_array($result); $i++)
            {

                // 새창 띄우기인지
                $bn_new_win = ($row['bn_new_win']) ? ' target="_blank"' : '';

                $bimg = $g4['path_pc'].'/data/banner/'.$row['bo_image_head'];
                if (file_exists($bimg))
                {
                    $size = getimagesize($bimg);

                    if($size[2] < 1 || $size[2] > 16)
                        continue;

                    if($max_width < $size[0])
                        $max_width = $size[0];

                    if($max_height < $size[1])
                        $max_height = $size[1];

                    echo '<div class="swipe-page'.$bn_first_class.'" id="wsection-'.$i.'" rel="banner">'.PHP_EOL;
                    echo '<div class="thumb2">'.PHP_EOL;
                    echo '<div class="img">'.PHP_EOL;
                    if ($row['bo_link'])
                        echo '<a href="'.$row['bo_link'].'" '.$bn_new_win.'>';

                    echo '<img src="'.$g4['url_pc'].'/data/banner/'.$row['bo_image_head'].'" width="'.$size[0].'" alt="'.$row['bn_alt'].'" alt="'.$row['bo_subject'].'">'.PHP_EOL;
                    if($row['bo_link'])
                        echo '</a>'.PHP_EOL;
                    echo '</div>'.PHP_EOL;
                    echo '</div>'.PHP_EOL;
                    echo '</div>'.PHP_EOL;

                    $bn_first_class = '';
                }
            }
            ?>
            
        </div>

        <button type="button" class="arrow-btn prev" onclick="mv.prev();">이전</button>
        <button type="button" class="arrow-btn next" onclick="mv.next();">이전</button>

        <div id="slide-bullet-list" class="bullet-list">
        </div>
        
    </div>

</div> <!-- swipebox -->

<script type="text/javascript">
    window.mv = Swipe(document.getElementById('main_banner_wrap'), {
        startSlide: 0,
        auto: 3000,
        loop:true, // 없는데 추가해봤음
        continuous: true,
        disableScroll: false,
        stopPropagation: false,
        callback: function(index, element) {
            banner_pageing("#slide-bullet-list", mv.getPos(), mv.getNumSlides());
        },
        transitionEnd: function(index, element) {}
    });
    function banner_pageing(el, page, pageSize) {
        $(el +" .icon").removeClass("on");
        $(el +" #icon-"+(page+1)).addClass("on");
    }
    rendering_page("#slide-bullet-list", mv.getPos(), mv.getNumSlides());
    function rendering_page(el, page, pageSize) {
        if (!page) page = 1;
        for (i=1; i<=pageSize ;i++ ) {
            $(el).append('<span id="icon-'+i+'" class="icon '+ (page==i?"on":"") +'">'+i+'</span>');
        }
    }
</script>

<?php } ?>

답변 1개 / 댓글 1개

채택된 답변
+20 포인트
2019-03-25 (월) 17:23:54

loop에 대한 속성값이 정의되지 않은듯합니다. 제작의뢰로 가야할듯하네요

답변에 대한 댓글 1개

2019-03-25 (월) 18:31:47
그런가요? ㅜㅜ 답변 감사합니다~~~

답변을 작성하려면 로그인이 필요합니다.