Skip to content

Commit 33f8074

Browse files
committed
Merge pull request #1338 from blueyed/lazy-slides
lazyLoad: per slide
2 parents 97c5b24 + fd0b4d7 commit 33f8074

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jquery.fullPage.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@
568568

569569
var startingSlide = that.find(SLIDE_ACTIVE_SEL);
570570

571-
//if the slide won#t be an starting point, the default will be the first one
571+
//if the slide won't be an starting point, the default will be the first one
572572
if(!startingSlide.length){
573573
slides.eq(0).addClass(ACTIVE);
574574
}
@@ -1342,6 +1342,10 @@
13421342
*/
13431343
function lazyLoad(destiny){
13441344
//Lazy loading images, videos and audios
1345+
var slide = destiny.find(SLIDE_ACTIVE_SEL);
1346+
if( slide.length ) {
1347+
destiny = $(slide);
1348+
}
13451349
destiny.find('img[data-src], video[data-src], audio[data-src]').each(function(){
13461350
$(this).attr('src', $(this).data('src'));
13471351
$(this).removeAttr('data-src');
@@ -1634,6 +1638,7 @@
16341638
}
16351639

16361640
destiny.addClass(ACTIVE).siblings().removeClass(ACTIVE);
1641+
lazyLoad(destiny);
16371642

16381643
if(!options.loopHorizontal && options.controlArrows){
16391644
//hidding it for the fist slide, showing for the rest

0 commit comments

Comments
 (0)