Home >Web Front-end >JS Tutorial >js tips--automatically hide the red cross_image special effects

js tips--automatically hide the red cross_image special effects

WBOY
WBOYOriginal
2016-05-16 19:10:161341browse

When the linked image in the article fails, you will see an annoying red cross. Although the image has alt attributes that can remedy the meaning of the image, it still gives people an unfriendly feeling.
If you add a judgment to the image, it will not be displayed when loading fails, which can produce a more satisfying user experience.
The code is as follows:
js tips--automatically hide the red cross_image special effects

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn