文章正文图片loding

来源:互联网 发布:淘宝现货指的是什么 编辑:程序博客网 时间:2024/05/01 19:06

javascript:

var bodyimg = document.body.getElementsByTagName('img');$.each(bodyimg , function(i, n){var src = $(n).attr('ysrc');if(src){$(n).attr('src',$(n).attr('ysrc'));}});
php:

$newlist->content = preg_replace('/<img.*?src="(.*?)".*?>/i',"<img src='img_loading.jpg' ysrc='$1'>",$newlist->content);

原文地址:http://www.xiaocai.name/emlog/post/57