You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
487 B
JavaScript
22 lines
487 B
JavaScript
6 years ago
|
//
|
||
|
$(document).ready(function(fn) {
|
||
|
$('img').each(function(index, element) {
|
||
|
var obj = $(this);
|
||
|
var _src = obj.attr('src');
|
||
|
if(_src.indexOf('http') == -1){
|
||
|
_src = 'http://data.chinahighlights.com' + _src;
|
||
|
}
|
||
|
obj.attr('src','http://data.chinahighlights.com/pic/grey.gif');
|
||
|
obj.attr('data-original',_src);
|
||
|
obj.addClass('lazy');
|
||
|
});
|
||
|
console.log('a')
|
||
|
lazy()
|
||
|
});
|
||
|
function lazy(){
|
||
|
console.log('b');
|
||
|
$("img.lazy").show().lazyload({
|
||
|
effect : "fadeIn",
|
||
|
});
|
||
|
}
|