jQuery(function(){ var ParentId = 'ChirashiplusDiv'; var ThumbSize = jQuery('#'+ParentId).innerWidth() - 4; var Flyers = [ { id: 26378908, code: '76a7f4991611b0649a8e34046d406fdc', expose: '', title: 'サカゼンのお得なSALE!', client: 'sakazen', thumb_uri: '//cips.chirashiplus.tv/1653/26378908/0/framein-288-288.jpg', cms: 'cms.mechao.tv', storeid: 97386 } ]; function calcThumbParam( img, directive, areasize ) { var matches = /\{thumb-(all|r|l)\}/.exec( directive ); var expose = 'all'; if ( matches ) { expose = matches[1]; } var clip = { w: (expose=='all' ? img.width : img.width/2), h: img.height }; var ratio = (Math.floor(clip.h / clip.w)==0 ? areasize / clip.w : areasize / clip.h); img.width *= ratio; img.height *= ratio; var ret = { imgWidth: img.width * (expose=='all' ? 1 : 0.5), imgHeight: img.height, marginLeft: (expose=='r' ? img.width*(-0.5) : 0) }; return ret; } jQuery.each(Flyers,function(){ var flyer = this; var thumb = jQuery(''); var divId = 'Flyer' + flyer.id; jQuery('#'+ParentId).append( jQuery('
') ); thumb.load(function(){ var img = thumb.get(0); var div = jQuery('#'+divId); var imgView = jQuery(''); div.append( jQuery('').text( flyer.title ) ) .append( jQuery('