Skip to content

Handle ALL images not found on your website automatically with ease!

License

Notifications You must be signed in to change notification settings

MarketingPipeline/Image-Fallback.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Image-Fallback.js

Image Fallback Support - Handle Image Errors With Ease

Automatically provide fallback support for all <img> / images not found!
Show your support!

Example and Usage

You can view a demo of Image-Fallback.js in use here.

How to use Image-Fallback.js:

include this script anywhere in your HTML document.

<script src="https://cdn.jsdelivr.net/gh/MarketingPipeline/Image-Fallback.js/version/1.0.0/dist/image-fallback.min.js" defer></script>

then you are done! All images that do not have a valid source will show a default image with Image Not Found


How to change the default error image:

To change the default error image you will need to set a variable named FallbackImageError with a valid image source (URL or path). Example below -

var FallbackImageError = "path/to/valid/image.png"

Contributing GitHub

Want to improve this project? Create a pull request with detailed changes / improvements! If approved you will be added to the list of contributors of this awesome project.

See also the list of contributors who participate in this project.

License GitHub

This project is licensed under the GPL-3.0 License - see the LICENSE.md file for details.