//ヘッダー=================================================================================== jQuery(function(){ /* ナビゲーション */ jQuery('.js-anime-common-header-hover').hover(function () { jQuery(this).children('div').stop(true).slideDown(100); return false; }, function () { jQuery(this).children('div').stop(true).slideUp(100); return false; }); //ブランドヘッダー追従 jQuery(window).scroll(function () { let nav = jQuery('.common-header').height(); if(jQuery('.brand-header-wrap').length){ if(jQuery(window).scrollTop() > nav) { jQuery('.brand-header-wrap').addClass('brand-header-fixed'); }else{ jQuery('.brand-header-wrap').removeClass('brand-header-fixed'); } } if(jQuery('.corporate-nav-area').length){ if(jQuery(window).scrollTop() > nav) { jQuery('.corporate-header-wrap').addClass('corporate-header-fixed'); }else{ jQuery('.corporate-header-wrap').removeClass('corporate-header-fixed')f(!jQuery('.page-category, .page-search').length){ if(jQuery('.online-header-wrap').length){ if(jQuery(window).scrollTop() > nav) { jQuery('.online-header-wrap').addClass('online-header-fixed'); }else{ jQuery('.online-header-wrap').removeClass('online-header-fixed'); } } } }); }); //絞り込み補足追加=================================================================================== jQuery(window).load(function () { //html生成 setTimeout(function(){ if(jQuery('#block_of_filter').length) { jQuery('#block_of_filter .js-filter-box').each(function() { let LightningAearchItemName = jQuery(this).find('.block-filter--list-inner-label-title').text(); //サイズ if(LightningAearchItemName.indexOf('サイズ') > -1){ jQuery(this).find('.block-filter--list-inner-accordion').prepend('
サイズ選びのポイント
'); } }); } },3000); }); jQuery(function () { //モーダル開く jQuery(document).on('click', '.js-filter-box .lt_question_modal', function(){ let jsClickQuestionModalName = jQuery(this).attr('id'); if(jsClickQuestionModalName){ jQuery('body').addClass(jsClickQuestionModalName); } jQuery('body').addClass('lt-filter-modal-on'); }); //モーダル閉じる(ボタン) jQuery(document).on('click', '.lt_question_item_modal_close', function(){ let jsClickQuestionModalClose = jQuery(this).parents('.js_question_modal_box').children('div').attr('class'); if(jsClickQuestionModalClose){ jQuery('body').removeClass(jsClickQuestionModalClose); } jQuery('body').removeClass('lt-filter-modal-on'); }); //モーダル閉じる(背景) jQuery(document).on('click', '.lt-question-modal-overlay', function(){ jQuery('body').removeClass("[class^='js_question_modal_']"); jQuery('body').removeClass('lt-filter-modal-on'); }); }); //商品スペックページ対応=================================================================================== /* -------------一覧-------------- */ jQuery(window).load(function () { if(jQuery('.block-product-comparison-follow-list').length){ //チェックがついている商品を保存 jQuery('.block-goods-ist-comp-check').each(function(){ let loadCompGoodsShow = jQuery(this).children('input:checked').attr('value'); if(loadCompGoodsShow){ jQuery('.block-product-comparison-follow-item[data-goods-code=' + loadCompGoodsShow + ']').show(); } }); function productComparisonPerformGoodsComp() { return new Promise((resolve, reject) => { goodsCompUtil.compCheckCountProcNum(); resolve(); }); } productComparisonPerformGoodsComp().then(() => { setTimeout(function(){ let goodsCompElementsHt = jQuery('.block-product-comparison-follow-bk').outerHeight(); jQuery('.block-product-comparison-follow-bk').css({ 'bottom': -goodsCompElementsHt, //'opacity': '1', }); //jQuery('.block-page-top').animate({bottom: 35}); jQuery('.block-product-comparison-follow-count-btn').css('pointer-events', 'auto'); }); }); } }); jQuery(function () { //スライダー矢印の挙動 jQuery('body').on('click', '.block-product-comparison-follow-list .slide-next', function () { let now = jQuery('.block-product-comparison-follow-item-list').scrollLeft(); let width = jQuery('.block-product-comparison-follow-item-list > .block-product-comparison-follow-item').outerWidth() + 10; let pageCount = Number(jQuery("#compGoods_PageCount").val()); let visibleElementsCount = goodsCompUtil.getAmountOfCompGoods().length; const amountOfViewGoods = 3; jQuery("#compGoods_PageCount").val(pageCount + 1); jQuery('.block-product-comparison-follow-item-list').animate({ scrollLeft: now + width }, 300); jQuery('.block-product-comparison-follow-list .slide-prev').removeClass('no-more'); if(visibleElementsCount - pageCount <= amountOfViewGoods){ jQuery('.block-product-comparison-follow-list .slide-next').addClass('no-more'); }else{ jQuery('.block-product-comparison-follow-list .slide-next').removeClass('no-more'); } }); jQuery('body').on('click', '.block-product-comparison-follow-list .slide-prev', function () { let now = jQuery('.block-product-comparison-follow-item-list').scrollLeft(); let width = jQuery('.block-product-comparison-follow-item-list > .block-product-comparison-follow-item').outerWidth() + 10; let pageCount = Number(jQuery("#compGoods_PageCount").val()); jQuery('.block-product-comparison-follow-item-list').animate({ scrollLeft: now - width }, 300); jQuery("#compGoods_PageCount").val(pageCount - 1); if (pageCount - 1 <= 1) { jQuery('.block-product-comparison-follow-list .slide-prev').addClass('no-more'); } jQuery('.block-product-comparison-follow-list .slide-next').removeClass('no-more'); }); //非表示ボタン jQuery(document).on('click', '.block-product-comparison-follow-hide', function(){ let goodsCompElementsHt = jQuery('.block-product-comparison-follow-bk').outerHeight(); if (jQuery(this).hasClass('product-comparison-close')) { jQuery(this).removeClass('product-comparison-close'); jQuery(this).children('span').text('非表示'); jQuery('.block-product-comparison-follow-bk').animate({bottom: 0}); jQuery('.block-product-comparison-follow-count-btn').hide().animate({bottom: goodsCompElementsHt + 35}); jQuery('.block-page-top').animate({bottom: goodsCompElementsHt + 35}); }else{ jQuery(this).addClass('product-comparison-close'); jQuery(this).children('span').text('表示'); jQuery('.block-product-comparison-follow-bk').animate({bottom: -goodsCompElementsHt}); jQuery('.block-product-comparison-follow-count-btn').show().animate({bottom: 35}); jQuery('.block-page-top').animate({bottom: 35}); } }); //比較するボタン jQuery(document).on('click', '.block-product-comparison-follow-count-btn', function(){ jQuery('.block-product-comparison-follow-list .slide-prev').addClass('no-more'); let goodsCompElementsHt = jQuery('.block-product-comparison-follow-bk').outerHeight(); let visibleElementsCount = goodsCompUtil.getAmountOfCompGoods().length; if(visibleElementsCount >= 4){ jQuery('.block-product-comparison-follow-item-list').scrollLeft(0); } if(visibleElementsCount == 0){ jQuery('.block-product-comparison-follow-bk').css('opacity', '0'); return false; }else{ jQuery('.block-product-comparison-follow-bk').addClass('follow-open'); goodsCompUtil.compCheckCountProcNum(); jQuery('.block-product-comparison-follow-bk').animate({bottom: '0'}); jQuery(this).hide().animate({bottom: goodsCompElementsHt + 35}); jQuery('.block-page-top').animate({bottom: goodsCompElementsHt + 35}); //ページTOP戻る jQuery('.block-product-comparison-follow-bk').css('opacity', '1'); //初期化 jQuery('.block-product-comparison-follow-hide').removeClass('product-comparison-close'); jQuery('.block-product-comparison-follow-hide').children('span').text('非表示'); } }); //一覧 if(jQuery('.block-product-comparison-follow-list').length){ if(!jQuery('.page-goods').length){ jQuery('.block-product-comparison-follow-item-list > div').hide(); } //チェックがついている商品を表示 let cookieGoodsList = goodsCompUtil.getAmountOfCompGoods(); if(cookieGoodsList.length > 5){ cookieGoodsList = cookieGoodsList.slice(-5); } if(cookieGoodsList.length > 0) { cookieGoodsList.forEach((goods) => { goodsCompUtil.addGoodsInfoToCompList(goods); jQuery('.block-goods-ist-comp-check input[type="checkbox"][value="' + goods + '"]').prop('checked', true); }); } } // //商品詳細 // if(jQuery('.block-detail-goods-comp-check input[type="checkbox"]').length){ // let loadCompGoodsShow = jQuery('.block-detail-goods-comp-check input[type="checkbox"]').attr('value'); // if (jQuery('.block-detail-goods-comp-check input[type="checkbox"]').prop('checked')) { // jQuery('.block-product-comparison-follow-item[data-goods-code=' + loadCompGoodsShow + ']').show(); // }else{ // jQuery('.block-product-comparison-follow-item[data-goods-code=' + loadCompGoodsShow + ']').hide(); // } // } //チェック jQuery('.block-goods-ist-comp-check input[type="checkbox"]').change(function() { let loadCompGoodsShow = jQuery(this).attr('value'); let visibleElementsCount = goodsCompUtil.getAmountOfCompGoods().length; if (jQuery(this).prop('checked')) { if(visibleElementsCount >= 5){ alert('製品比較は5件までとなります。追加する場合は、比較ページから商品を削除してください。'); jQuery(this).prop('checked', false); return; } function productComparisonPerformGoodsCompAdd() { return new Promise((resolve, reject) => { goodsCompUtil.addSelectedGoods(loadCompGoodsShow); resolve(); }); } productComparisonPerformGoodsCompAdd().then(() => { setTimeout(function(){ let goodsCompElementsHt = jQuery('.block-product-comparison-follow-bk').outerHeight(); if(!jQuery('.block-product-comparison-follow-bk').hasClass('follow-open')){ jQuery('.block-product-comparison-follow-bk').css({ 'bottom': -goodsCompElementsHt, 'opacity': '0', }); //jQuery('.block-page-top').animate({bottom: 35}); }else{ if(!jQuery('.block-product-comparison-follow-hide').hasClass('product-comparison-close')){ jQuery('.block-product-comparison-follow-count-btn').animate({bottom: goodsCompElementsHt + 35}); jQuery('.block-product-comparison-follow-bk').css('opacity', '1'); //jQuery('.block-page-top').animate({bottom: goodsCompElementsHt + 35}); } } },200); }); }else{ function productComparisonPerformGoodsCompRemove() { return new Promise((resolve, reject) => { goodsCompUtil.removeSelectedGoods(loadCompGoodsShow); resolve(); }); } productComparisonPerformGoodsCompRemove().then(() => { let visibleElementsCount = goodsCompUtil.getAmountOfCompGoods().length; let goodsCompElementsHt = jQuery('.block-product-comparison-follow-bk').outerHeight(); if(visibleElementsCount == 0){ jQuery('.block-product-comparison-follow-bk').animate({bottom: -goodsCompElementsHt}); jQuery('.block-product-comparison-follow-bk').css('opacity', '0'); //jQuery('.block-page-top').animate({bottom: 35}); jQuery('.block-product-comparison-follow-count-btn').animate({bottom: 35}); jQuery('.block-product-comparison-follow-bk').removeClass('follow-open'); jQuery('.block-product-comparison-follow-hide').removeClass('product-comparison-close'); jQuery('.block-product-comparison-follow-hide').children('span').text('非表示'); } }); } }); //削除ボタン(PC) jQuery(document).on('click', '.block-product-comparison-del', function(){ let compCheckGoodsCode = jQuery(this).parents('.block-product-comparison-follow-item').attr('data-goods-code'); jQuery('.block-product-comparison-follow-item[data-goods-code=' + compCheckGoodsCode + ']').remove(); jQuery('.block-goods-ist-comp-check input[value=' + compCheckGoodsCode + ']').prop('checked', false); goodsCompUtil.removeSelectedGoods(compCheckGoodsCode); let goodsCompElementsHt = jQuery('.block-product-comparison-follow-bk').outerHeight(); let visibleElementsCount = goodsCompUtil.getAmountOfCompGoods().length; if(visibleElementsCount == 0){ jQuery('.block-product-comparison-follow-bk').animate({bottom: -goodsCompElementsHt}); jQuery('.block-product-comparison-follow-bk').css('opacity', '0'); //jQuery('.block-page-top').animate({bottom: 35}); jQuery('.block-product-comparison-follow-count-btn').animate({bottom: 35}); jQuery('.block-product-comparison-follow-bk').removeClass('follow-open'); jQuery('.block-product-comparison-follow-hide').removeClass('product-comparison-close'); jQuery('.block-product-comparison-follow-hide').children('span').text('非表示'); }else{ jQuery('.block-product-comparison-follow-count-btn').animate({bottom: goodsCompElementsHt + 35}); //jQuery('.block-page-top').animate({bottom: goodsCompElementsHt + 35}); } }); });