jQuery(function(){ var ParentId = 'ChirashiplusFlyersListDivF'; jQuery('#'+ParentId).append('

家具

'); var ThumbSize = jQuery('#'+ParentId).innerWidth() - 4; var Flyers = [ { id: 32636833, code: '6342e2a27087c5424430b5ce0f0dee23', expose: '', mode: 'F', title: 'バイヤーセレクション ~ パーソナルチェア・デスクチェア特集', client: 'shimachu', from: '20250703', now: '20250704', fromto: '2025年7月3日 ~ 2025年8月4日', sale: '売出期間:7/4 ~ 8/4', linkurl: '', thumburl: 'https://cips.chirashiplus.tv/2526/32636833/0/framein-150-210.jpg' }, ]; //リンククリック時 jQuery(document).on('click', '#' + ParentId + ' a', function(){ var linkurl = jQuery(this).parents('.shopflyer-list-item').attr('linkurl'); var fid = jQuery(this).parents('.shopflyer-list-item').attr('fid'); var code = jQuery(this).parents('.shopflyer-list-item').attr('code'); var client = jQuery(this).parents('.shopflyer-list-item').attr('client'); var clientId = 2526; var storeId = 86042; var storeExtId = 'bab5f681ed696c3467b4300e34d27363'; var cmsFqdn = 'cms.mechao.tv'; var flyerUrl = 'https://' + cmsFqdn + '/' + client + '/flyer_redirect?s=' + storeExtId + '&' + 'eid=' + code; if ( linkurl ) { window.open(linkurl, '_blank'); } else { window.open(flyerUrl, '_blank'); } return false; }); //サムネイル画像 縦横サイズ設定 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); var ret = { imgWidth: img.width * (expose=='all' ? 1 : 0.5), imgHeight: img.height, marginLeft: (expose=='r' ? img.width*(-0.5) : 0) }; return ret; } if (Flyers.length != 0) { //ULタグを追加する jQuery('#'+ParentId).append(''); //公開中のチラシ数分 繰り返す jQuery.each(Flyers, function(){ var flyer = this; var thumb = jQuery(''); var divId = 'Flyer' + flyer.id + flyer.mode; // セールス期間 or 表示期間 if (flyer.sale != "") { var flyersale = flyer.sale; } else { var flyersale = flyer.fromto; } // NEWマーク if (flyer.from == flyer.now) { var newmark = ''; } else { var newmark = ""; } //チラシブロックを表示する jQuery('#'+ParentId+" ul.shopflyer-list").append( jQuery('
  • ') ); //チラシ情報を表示する thumb.on('load', function(){ var img = thumb.get(0); var imgView = jQuery('
    '); var thumbParam = calcThumbParam( img, flyer.expose, imgView.innerWidth() ); jQuery('#'+divId).append( jQuery(imgView) .append( jQuery(img).css('margin-left',thumbParam.marginLeft) ) //.css( { width: thumbParam.imgWidth, height: thumbParam.imgHeight } ) ); jQuery('#'+divId).append( jQuery('
    ') .append( jQuery('

    ').append(flyer.title) ) .append( jQuery('

    ') .append( jQuery(newmark) ).append( flyersale ) ) .append( jQuery('
    チラシを見る
    ') ) ); }) .attr('src', flyer.thumburl); }); } else { jQuery('#'+ParentId).append( jQuery('
    現在、配信しているチラシはございません。
    ') ); } });