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

anythingSlider 라는 이미지 슬라이더 자바스크립트를 쓰려고 하는데요

· 14년 전 · 2569 · 4
html로 작업했을 때는 전혀 문제가 없었는데
그누보드 배우고 여기에 쓰려하니 스크립트가 문제가 되네요.

오류: 개체가 이 속성 또는 메서드를 지원하지 않습니다.

<script type="text/javascript">
function formatText(index, panel) {
return index + "";
}
$(function () {
$('.anythingSlider').anythingSlider({
easing: "easeInOutExpo", // Anything other than "linear" or "swing" requires the easing plugin
autoPlay: true, // This turns off the entire FUNCTIONALY, not just if it starts running or not.
delay: 6000, // How long between slide transitions in AutoPlay mode
startStopped: false, // If autoPlay is on, this can force it to start stopped
animationTime: 600, // How long the slide transition takes
hashTags: true, // Should links change the hashtag in the URL?
buildNavigation: true, // If true, builds and list of anchor links to link to each slide
pauseOnHover: true, // If true, and autoPlay is enabled, the show will pause on hover
startText: "", // Start text
stopText: "", // Stop text
navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
});
$("#slide-jump").click(function(){
$('.anythingSlider').anythingSlider(4);
});

});
</script>

$('.anythingSlider').anythingSlider({ 부분에서 계속 걸립니다.
.anythingSlider 가 선언된 css도 스크립트보다 먼저 불어오고 있구요.
위 슬라이딩 플러그인을 위한 자바소스들도 순서대로 먼저 불러오게 해놨습니다.

그누보드 배우면서 php가 처음인데 저 함수?는 .php 확장명에서는 못쓰는건가요?
다른 분(행님님)은 쓰셨던데
제대로 동작되는 행님님의 테스트 사이트입니다.
http://work.nanzoa.com/index3.php

저는 왜 안될까요? 4시간째 헤매고 있습니다. 조언 부탁드립니다.

댓글 작성

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

로그인하기

댓글 4개

혹시 충돌이 나서 그런지 모르니
위 스크립트에 쓰인 $ 를 jQuery 라는 글자로 대체해보세요.

즉..
jQuery(function () {
jQuery('.anythingSlider').anythingSlider({
easing: "easeInOutExpo", // Anything other than "linear" or "swing" requires the easing plugin
autoPlay: true, // This turns off the entire FUNCTIONALY, not just if it starts running or not.
delay: 6000, // How long between slide transitions in AutoPlay mode
startStopped: false, // If autoPlay is on, this can force it to start stopped
animationTime: 600, // How long the slide transition takes
hashTags: true, // Should links change the hashtag in the URL?
buildNavigation: true, // If true, builds and list of anchor links to link to each slide
pauseOnHover: true, // If true, and autoPlay is enabled, the show will pause on hover
startText: "", // Start text
stopText: "", // Stop text
navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
});
jQuery("#slide-jump").click(function(){
jQuery('.anythingSlider').anythingSlider(4);
});

});
아고 나가서 식사하고 온 동안 답변들 달아주셨네요. 감사합니다. 확인해보겠습니다.
올래님 감사합니다. $를 jQuery로 대체해도 되나보군요.
일단 바꿔도 안되길래 행님님? 어라 행님님 ㅋ
답글 쓰다보니... 위에 언금했던 행님님께서 직접 조언 달아주셨군요. 감사합니다. 말씀하신대로 하나하나 주석처리 해보다보니
불행히도 그누보드 기본 common.js 내용들 중 뭐랑 충돌나나봅니다.
일단 그부분 넘어가서 다른부분 오류나는거 보니 그쪽이랑 문제 있는 것 같아 시간가지고 한번 훌터봐야겠네요. 어떻게 되면 충돌나는지... 또 분석해봐야겠네요.
두분 모두 정말 감사합니다.
아주 어깨, 허리, 등짝... 뻐근하네요.
문제를 참 오래걸려 찾았습니다.
구글뉴스나 스크롤게시판 등에 쓰이는
jquery.js 와 충돌(conflict) 되는 문제였습니다.
jquery.js 는 여러방면에 많이 쓰이는거 같은데 해결 방법은 anythingSlider.js 등 슬라디어 관련된 스크립트보다 먼저 넣어주면 되네요.

예로

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="<?=$g4[path]?>/js/jquery.js"></script> <!-- 슬라이더관련 스크립트보다 먼저 삽입 -->
<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery.easing.1.2.js"></script>
<script type="text/javascript" src="<?=$latest_skin_path?>/js/jquery.anythingslider.js"></script>

구글링하다보니 꽤 많은 사람들이 고생했던거 같습니다. ㅠㅠ
혹시나 저같은 경우를 겪으시는 분들 위해 답변 업데이트 했습니다.

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440