admin管理员组文章数量:1430626
is there a way to get safari not to show the "broken image" symbol, when an image was not found? firefox does this by default.
i'd preferrably do this with css, but i think javascript will be the way to go... i am using jquery already, eg something like this would be great:
$(document).ready(function(){
$('img').broken().hide();
});
is there a way to get safari not to show the "broken image" symbol, when an image was not found? firefox does this by default.
i'd preferrably do this with css, but i think javascript will be the way to go... i am using jquery already, eg something like this would be great:
$(document).ready(function(){
$('img').broken().hide();
});
Share
Improve this question
asked Aug 28, 2010 at 11:16
Patrick OscityPatrick Oscity
54.7k18 gold badges146 silver badges169 bronze badges
2 Answers
Reset to default 6From the jQuery documentation:
$("img").error(function(){
$(this).hide();
});
There is and event handler called onerror which you can add to the images:
<img src="image.png" onerror="this.style.visibility = 'hidden'" />
本文标签: javascriptget safari to not show broken image symbolStack Overflow
版权声明:本文标题:javascript - get safari to not show broken image symbol - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745534677a2662217.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论