제이쿼리 충돌? 채택완료
에라모르겠다
8년 전
조회 3,966
단독으로 썼을때는 구동이 되는데
메인페이지에 출력하려고 하니 구동이 안되는데여..
혹시 메인에 다른 슬라이드와 prev next 이름이 똑같아서 그런가여 ?
ㅠ;ㅠ 이름을 바꾸면 되나요 ? 된다면 어디어디를 바꿔야되는지 좀 알려주세요,ㅠㅠ
도와주세여 ..;
- 1. '보코' 손승연, 美 버클리 음대 합격 "버클리도 반했다"2011.08.11
- 2. K팝스타 러브라인, 이승훈 두고 백아연·이미쉘 신경전?2011.08.11
- 3. '내 아내의 모든 것', '어벤져스' 제쳤다..예매율 1위...2011.08.11
- 4. '사랑비' 이미숙-정진영, 아름다운 이별…2011.08.11
- 5. 최효종, 다시 한 번 강용석 의원이 고소한다면?2011.08.11
http://mylko72.maru.net/jquerylab/images/ico/bul_arrow_up.gif" alt="Prev">
http://mylko72.maru.net/jquerylab/images/ico/bul_arrow_down.gif" alt="Next">
function fn_article3(containerID, buttonID, autoStart){
var $element = $('#'+containerID).find('.notice-list');
var $prev = $('#'+buttonID).find('.prev');
var $next = $('#'+buttonID).find('.next');
var $play = $('#'+containerID).find('.control > a.play');
var $stop = $('#'+containerID).find('.control > a.stop');
var autoPlay = autoStart;
var auto = null;
var speed = 2000;
var timer = null;
var move = $element.children().outerHeight();
var first = false;
var lastChild;
lastChild = $element.children().eq(-1).clone(true);
lastChild.prependTo($element);
$element.children().eq(-1).remove();
if($element.children().length==1){
$element.css('top','0px');
}else{
$element.css('top','-'+move+'px');
}
if(autoPlay){
timer = setInterval(moveNextSlide, speed);
$play.addClass('on').text('▶');
auto = true;
}else{
$play.hide();
$stop.hide();
}
$element.find('>li').bind({
'mouseenter': function(){
if(auto){
clearInterval(timer);
}
},
'mouseleave': function(){
if(auto){
timer = setInterval(moveNextSlide, speed);
}
}
});
$play.bind({
'click': function(e){
if(auto) return false;
e.preventDefault();
timer = setInterval(moveNextSlide, speed);
$(this).addClass('on').text('▶');
$stop.removeClass('on').text('▣');
auto = true;
}
});
$stop.bind({
'click': function(e){
if(!auto) return false;
e.preventDefault();
clearInterval(timer);
$(this).addClass('on').text('■');
$play.removeClass('on').text('▷');
auto = false;
}
});
$prev.bind({
'click': function(){
movePrevSlide();
return false;
},
'mouseenter': function(){
if(auto){
clearInterval(timer);
}
},
'mouseleave': function(){
if(auto){
timer = setInterval(moveNextSlide, speed);
}
}
});
$next.bind({
'click': function(){
moveNextSlide();
return false;
},
'mouseenter': function(){
if(auto){
clearInterval(timer);
}
},
'mouseleave': function(){
if(auto){
timer = setInterval(moveNextSlide, speed);
}
}
});
function movePrevSlide(){
$element.each(function(idx){
if(!first){
$element.eq(idx).animate({'top': '0px'},'normal',function(){
lastChild = $(this).children().eq(-1).clone(true);
lastChild.prependTo($element.eq(idx));
$(this).children().eq(-1).remove();
$(this).css('top','-'+move+'px');
});
first = true;
return false;
}
$element.eq(idx).animate({'top': '0px'},'normal',function(){
lastChild = $(this).children().filter(':last-child').clone(true);
lastChild.prependTo($element.eq(idx));
$(this).children().filter(':last-child').remove();
$(this).css('top','-'+move+'px');
});
});
}
function moveNextSlide(){
$element.each(function(idx){
var firstChild = $element.children().filter(':first-child').clone(true);
firstChild.appendTo($element.eq(idx));
$element.children().filter(':first-child').remove();
$element.css('top','0px');
$element.eq(idx).animate({'top':'-'+move+'px'},'normal');
});
}
}
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
8년 전
보통 jquery 충돌은 js include 순서에 상관있습니다.
(plugin 설정)
를
와 같이 바꿔보시고..
정확한건 오류 로그를 봐야 알꺼 같긴합니다..
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
8년 전
확인해보니
이 부분이 문제입니다.
위 영역을
</p><p><script type="text/javascript"></p><p>$(function(){</p><p><span style="white-space:pre"> </span>$(".control a").click(function(){</p><p><span style="white-space:pre"> </span>fn_article3('notice5','bt5',true);</p><p><span style="white-space:pre"> </span>});</p><p>});</p><p></script></p><div><span style="font-size: 11pt;">
로 변경해보세요
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인