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

Show different background image for desktop and mobile #2359

Closed
kaochihhui opened this issue Oct 26, 2016 · 1 comment
Closed

Show different background image for desktop and mobile #2359

kaochihhui opened this issue Oct 26, 2016 · 1 comment
Labels

Comments

@kaochihhui
Copy link

kaochihhui commented Oct 26, 2016

Hi Alvaro,

Thanks for the powerful library! It's really cool and amazing.

There is a situation we encounter:

The background image shown in desktop has very long width, thus in mobile the same image can not be used as the image will be shown weird.

Therefore we are thinking to use different images for desktop and mobile.

However if there are 2 images per slide (there will be around 40 slides), it will cause heavy loading.

We know that html5 "picture" tag can do the trick that only load the required image for either desktop mode or mobile mode.

Is there a similar way can be done in fullpage.js which will ease the loading?
Please kindly advice.

Thank you.

@alvarotrigo
Copy link
Owner

alvarotrigo commented Oct 26, 2016

  • Use media queries instead. The issue with srcset is being treated in this other topic.
  • Use the state classes added to fullpage.js or the callbacks to load backgrounds dynamically. See this answer.

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

No branches or pull requests

2 participants