GitHunt

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.

Languages

JavaScript100.0%

Contributors

GNU General Public License v3.0
Created August 12, 2022
Updated December 3, 2024
MarketingPipeline/Image-Fallback.js | GitHunt