페이지의 뉴스 섹션에 뉴스 티커를 사용하고 있으며 prettyphoto 플러그인을이 뉴스와 함께 사용하려고하지만 jquery 함수가 작동하지 않습니다. < li> 항목 그들의 위치를 바꿉니다. 첫 번째 항목이 마지막 될 때 jquery 함수가 뉴스 티커와 함께 작동하지 않습니다.
예를 들어 JQuery와 기능 중 어느 것도 여기에코드
$(document).ready(function(){
var first = 0;
var speed = 1000;
var pause = 3500;
function removeFirst(){
first = $('ul#listticker li:first').html();
$('ul#listticker li:first')
.animate({opacity: 0}, speed)
.fadeOut('slow', function() {$(this).remove();});
addLast(first);
}
function addLast(first){
last = '<li style="display:none">'+first+'</li>';
$('ul#listticker').append(last)
$('ul#listticker li:last')
.animate({opacity: 1}, speed)
.fadeIn('slow')
}
interval = setInterval(removeFirst, pause);
//Codes above are for the news ticker
$(".news").click(function(e){
e.preventDefault(); //I assign news class to links if there is no image for the news on db but it doesn't even work
});
$("#newsdiv a[rel^='gallery']").prettyPhoto({
theme:'light_rounded'
});
});
그리고 PHP 함수의 HTML 결과가 작동하지 않습니다
<ul id="listticker">
<li>
<img src="http://example.com/m.../k_haber.png"><a href="#" class="news">12.05.2011</a><span class="news-text">Some Title</span>
</li>
<li>
<img src="http://example.com/../some.png"><a href="http://example.com/../news/p_some.jpg" class="news-title" rel="gallery[dd0]"> 12.05.2011</a><span class="news-text">Some Other Title</span>
</li>
</ul>
모든 아이디어가 원인 일 수도 있고 해결 방법도있을 수 있습니다.
편집 :
나는 문제가 있기 때문에 JQuery와 HTML 선택의 발생 가정합니다.
덕분에 코드하지만 그것도 jsfiddle에, 하나가 작동하지 않았다, 이상한 것은 두 번째는 첫 번째가되는 1주기에서, 첫 번째가 아니라 두 번째 작품이다 그리고 두 번째 사이클 이후에는 아무 것도 작동하지 않습니다 .http : //jsfiddle.net/jfahv/6/ (내 영어는 유감입니다) –
'console.log()'가 실수로 남아있을 수 있습니다. 그것은 모두 나를 위해 작동합니다 ie7-9 및 ff4 – Zlatev