사진게시판을 최신글로 추출했는데 js 코드가 왜 나오는 걸까요? ㅠ ㅠ

사진게시판을 최신글로 추출했는데 js 코드가 왜 나오는 걸까요? ㅠ ㅠ

QA

사진게시판을 최신글로 추출했는데 js 코드가 왜 나오는 걸까요? ㅠ ㅠ

답변 1

본문

http://tamjin-eco.com/index00.php

 

페이지 중간의 뉴스 부분에 슬라이드 형식으로 보이는 최신글을 추출했는데 자꾸만 js 코드가 나와서 난감하네요 ㅠ ㅠ

 

페이지 상단의 메인 슬라이드와 충돌해서 이런 문제가 생기는 걸까요? ㅜ  ㅜ

슬라이드 형식 최신글 스킨은 웹학교님의 자료 다운 받아서 했어요.
https://sir.kr/g5_skin/45305?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%EC%8A%AC%EB%9D%BC%EC%9D%B4%EB%93%9C&page=1


------------------------------------------------------------------------
latest.skin.php의 내용은 아래와 같아요!
 

 

<?php

if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

include_once(G5_LIB_PATH.'/thumbnail.lib.php');

 

$thumb_width = 930;

$thumb_height = 200;

$list_count = (is_array($list) && $list) ? count($list) : 0;

?>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@splidejs/splide@latest/dist/css/splide.min.css">

<div id="splide3" class="splide">

    <div class="splide__track">

        <ul class="splide__list">

    <?php

    for ($i=0; $i<$list_count; $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'].'" >';

    $wr_href = get_pretty_url($bo_table, $list[$i]['wr_id']);

    ?>

        <li class="splide__slide">

            <a href="<?php echo $wr_href; ?>"><?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?></a>

        </li>

    <?php }  ?>

    <?php if ($list_count == 0) { //게시물이 없을 때  ?>

    <li>게시물이 없습니다.</li>

    <?php }  ?>

    </ul>

  </div>

</div>

<script src="https://cdn.jsdelivr.net/npm/@splidejs/splide@latest/dist/js/splide.min.js"></script>

<script>

    document.addEventListener( 'DOMContentLoaded', function () {

    //  new Splide( '#splide' ).mount();

    new Splide( '#splide3', {

            'type'      : 'loop',

            'direction' : 'ttb',

            'height'   : '10rem',

            'autoplay' : true,

    } ).mount();

    } );

 

</script>

 


 

이 질문에 댓글 쓰기 :

답변 1

thumb-1794697667_1631145169.0958_730x358.png

스크립트가 안보이네요?

맥북 사파리 브라우저 화면 캡처 입니다

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 18
© SIRSOFT
현재 페이지 제일 처음으로