直接上马
$('img').each(function(k,i) {
if($('img').eq(k).height()<200){
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
this.src = '/Public/Main/images/no-image.jpg';
}
}else{
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
this.src = '/Public/Main/images/error-image.jpg';
}
}
});
直接放在相应的js文件下就Ok了