我在我的項目中使用lazy loading plugin。我有一個有圖像的旋轉木馬。我需要在輪播中延遲加載圖像。這是HTML:懶惰加載不加載
@foreach($issues as $issue)
<div class="swiper-slide magazine-image lazy-carousel">
<div
class="slider-image-wrap js-magazine-selector"
data-id='{{ $issue->first()->magazine->id }}'
data-slug='{{ str_slug($issue->first()->magazine->name) }}'
data-name='{{ $issue->first()->magazine->name }}'
data-summary='{{ $issue->first()->magazine->summary ?: '' }}'
data-magazine-image='{{ $issue->first()->image }}'
data-magazine-visiolink='{{ $issue->first()->magazine->visio_link_prefix }}'
data-issue-image='{{ $issue->first()->magazine->image ?: '' }}'
>
<img data-src="/imagecache/medium/{{ $issue->first()->image }}">
<div class="magazine-overlay">
<div>
<p>{{ $issue->first()->magazine->name }}</p>
<a href="#">Se magasinet </a>
</div>
</div>
</div>
</div>
@endforeach
這是腳本:
$(document).ready(function() {
$('.lazy-carousel').Lazy({
scrollDirection: 'horizontal',
effect: 'fadeIn',
effectTime: 2000,
threshold: 0
});
});
但是,這也不行,圖像不是在所有加載。我該如何解決這個問題?
您的開發控制檯內的任何錯誤也許? (ctrl + shift + j) – ymz
在控制檯中沒有錯誤 – Leff