var loadImages = function(slide) {
var width = $(window).width();
//根据屏幕大小判断使用图片大小
var attrName = width > 480? 'large' : 'small';
$('img:jqmData('+attrName+')', slide).each(function(){
var img = $(this);
var source = img.jqmData(attrName);
if(source) img.attr('src', source).jqmRemoveData(attrName);
});
};
整个运行效果见:
您可能感兴趣的文章: