jquery 회전식 캐롤을 만들었습니다. 그러나 이전 버튼을 누르면 이미지가로드되기 전에 깜박입니다. 그 전에 액세스 한 이전의 이미지가로드되지 않은 목록 때문에 그 사실을 이해합니다. 항상 사전로드 할 수있는 방법이 있습니까? 무한한 스크롤링 컨베이어는 어떻게합니까? 누군가가 도울 수 있기를 바랍니다.jquery 회전 목마 깜박임 이미지 문제
<script>
$(document).ready(function(){
var interval = setInterval(function(){
$('#carousel ul').animate({marginLeft:-480},1000,function(){
$(this).find('li:last').after($(this).find('li:first'));
$(this).css({marginLeft:0});
})
},5000);
$('#next').click(function(){
$('#carousel ul').animate({marginLeft:-480},1000,function(){
$(this).find('li:last').after($(this).find('li:first'));
$(this).css({marginLeft:0});
});
return false;
});
$('#prev').click(function(){
$('#carousel ul').animate({marginLeft:480},1000,function(){
$(this).find('li:first').before($(this).find('li:last'));
$(this).css({marginLeft:0});
});
return false;
});
});
</script>
이것은 샘플을 사용하는 jfiddle입니다.
https://jsfiddle.net/amosangyongjian/4jan3t10/
확인이 데모를 당신을 도움이된다면 - http://fiddle.jshell.net/webninjataylor/R79Ma/light/ – Tasos
그렇지만 각 div는 각 이미지에 할당됩니다. 내 것은 목록이다. – JianYA