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

lazy load images in fullpage.js #287

Closed
Daniel-Oswald opened this issue Mar 6, 2014 · 15 comments
Closed

lazy load images in fullpage.js #287

Daniel-Oswald opened this issue Mar 6, 2014 · 15 comments

Comments

@Daniel-Oswald
Copy link

hey guys,
i am building a site with 4 sections that show a grid of images (around 20-30 images per section). I am afraid now the site is getting too heavy. Is there a way to load images after a section or slide has been entered? like lazy load for example?

cheers

@alvarotrigo
Copy link
Owner

Read this answer.

It is a combination of callbacks and CSS.

@alvarotrigo
Copy link
Owner

A new functionality for it has been added in fullPage.js 2.6.6.
Read more about it here.

@NoBodyButMe
Copy link

Is it possible to "lazy load" background-images too?

@alvarotrigo
Copy link
Owner

@KrisMerckx read two answers over yours...

@flatcapco
Copy link

@alvarotrigo what implication does this have to print? as I guess the data-src won't be updated until the image is viewed so print will miss these images?

@alvarotrigo
Copy link
Owner

@latwelve good point. I guess you would have to manually enable them with JavaScript or jquery if that's even possible...
Maybe the plugin could provide some forceLoad function or similar, but... for now I'm not even sure if it is possible to have a cross browser solution to detect a print...

I believe this is a problem all lazy load plugins experience as well and it's not something particular from fullPage.js

@flatcapco
Copy link

Yeah I couldn't work that out either... for this project I just mapped it to a button and set the jquery to swap the data-src for src... not ideal still as even though the GET requests for the images start pulling the print page will be up too soon.. so ideally the user would need to wait 10 seconds for them to fully load.

I think a function to trigger a preload of the other images is possible the way to go for me.

@davidhellmann
Copy link

Hey, cool works fine but is there an option to set an offset for loading the image a bit earlier? :)

@alvarotrigo
Copy link
Owner

is there an option to set an offset for loading the image a bit earlier? :)

Not yet. Maybe for the next release.
If you need it now contact me for an urgent request.

@davidhellmann
Copy link

@alvarotrigo ok sounds good. no thanks, it would be nice but it's not an urgent request :) Thanks!

@robinscholz
Copy link

Is there a way to either turn off lazy loading or trigger the load before the image enters the viewport?

@alvarotrigo
Copy link
Owner

@rbnschlz read this topic and use the onLeave event.

@Pixelsmith
Copy link

Is it possible to disable the lazy load autoinit and call it manually? I'd like to use LL for my second slide, but not the first. I can do the 'onLeave' event, but that seems like a lot more work since LL is now baked in.

@alvarotrigo
Copy link
Owner

@Pixelsmith Just don't use data-src if you dont want lazy loading. Use src.

@Pixelsmith
Copy link

Pixelsmith commented Jun 1, 2016

Not the answer I was looking for, but it did trigger the answer I needed.

The conflict I was having was that Lazy Load XT natively calls data-src, identical to FPJS. LLXT allows me to customize the SRC attribute with srcAttr, so I changed that and now everybody's playing nicely together.

Thanks,
A.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants