Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazyLoad: per slide #1338

Merged
merged 3 commits into from
Jun 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion jquery.fullPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@

var startingSlide = that.find(SLIDE_ACTIVE_SEL);

//if the slide won#t be an starting point, the default will be the first one
//if the slide won't be an starting point, the default will be the first one
if(!startingSlide.length){
slides.eq(0).addClass(ACTIVE);
}
Expand Down Expand Up @@ -1342,6 +1342,10 @@
*/
function lazyLoad(destiny){
//Lazy loading images, videos and audios
var slide = destiny.find(SLIDE_ACTIVE_SEL);
if( slide.length ) {
destiny = $(slide);
}
destiny.find('img[data-src], video[data-src], audio[data-src]').each(function(){
$(this).attr('src', $(this).data('src'));
$(this).removeAttr('data-src');
Expand Down Expand Up @@ -1634,6 +1638,7 @@
}

destiny.addClass(ACTIVE).siblings().removeClass(ACTIVE);
lazyLoad(destiny);

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