图片加载失败时,如何自动切换至预设默认图片?
- 内容介绍
- 文章标签
- 相关推荐
本文共计46个文字,预计阅读时间需要1分钟。
plaintext使用方法一:$(document).ready(function() { $('#img').error(function() { $(this).attr('src', 'default.jpg(默认图片的url)'); });});
gistfile1.txt方法一、 $('img').error(function(){ $(this).attr('src', "default.jpg(默认图片的url地址)"); }); 方法二.
本文共计46个文字,预计阅读时间需要1分钟。
plaintext使用方法一:$(document).ready(function() { $('#img').error(function() { $(this).attr('src', 'default.jpg(默认图片的url)'); });});
gistfile1.txt方法一、 $('img').error(function(){ $(this).attr('src', "default.jpg(默认图片的url地址)"); }); 方法二.

