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

Fallback to data-original if image fails to load #432

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

brianwozeniak
Copy link

@brianwozeniak brianwozeniak commented Feb 16, 2019

Updated so that if an image fails to load in data-src or data-srcset, it will revert to the original default src value as in:

<img src="default.jpg" data-src="imageToLoad.jpg" data-srcset="imageToLoad.jpg 1x, imageToLoadRetina.jpg 2x">

It does this by creating a data-original attribute when changing the src value.

Updated so that if an image fails to load in data-src or data-srcset, it will revert to the original default src value as in:

<img src="default.jpg" data-src="imageToLoad.jpg" data-srcset="imageToLoad.jpg 1x, imageToLoadRetina 2x">

It does this by creating a data-original attribute when changing the src value.
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

Successfully merging this pull request may close these issues.

1 participant