PageSourceSearch

https://albion.co.jp/resources/js/common_original.js

js albion.co.jp collected 2026-10-02 03:55:17 UTC 59,454 bytes, 1,447 lines download raw bytes

1(function($, window) {
2  $(function() {
3    "use strict";
4
5    var isSmartDevice = navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0;
6    var isTabletDevice = navigator.platform == "iPad" || (navigator.platform == "MacIntel" && navigator.userAgent.indexOf("Safari") != -1 && navigator.userAgent.indexOf("Chrome") == -1 && navigator.userAgent.indexOf("Firefox") == -1 && navigator.standalone !== undefined)
7    if(isSmartDevice){
8    } else if(isTabletDevice) {
9      /* --- header --- */
10      $('.block-header--default-menu-list-item-name').on('touchstart', function() {
11        $('.block-header--search').hide();
12        $('.block-header--search-container').hide();
13        if($(this).parent('.block-header--default-menu-list-item').hasClass('block-header--default-menu-list-item__active')) {
14          $(this).parent('.block-header--default-menu-list-item').removeClass('block-header--default-menu-list-item__active');
15        } else {
16          $('.block-header--default-menu-list-item').removeClass('block-header--default-menu-list-item__active');
17          $(this).parent('.block-header--default-menu-list-item').addClass('block-header--default-menu-list-item__active');
18        }
19      });
20    } else {
21      /* --- header --- */
22      $('.block-header--default-menu-list-item').on('mouseover', function() {
23        $(this).addClass('block-header--default-menu-list-item__active');
24        $('.block-header--search').hide();
25        $('.block-header--search-container').hide();
26      });
27      $('.block-header--default-menu-list-item').on('mouseout', function() {
28        $(this).removeClass('block-header--default-menu-list-item__active');
29      });
30    }
31    
32    /* --- header --- */
33    $('.block-header--hamburger-menu-open').on('click', function() {
34      $('.block-header--hamburger-menu').addClass('block-header--hamburger-menu__active');
35    });
36    $('.block-header--hamburger-menu-close').on('click', function() {
37      $('.block-header--hamburger-menu').removeClass('block-header--hamburger-menu__active');
38    });
39    $('.block-header--hamburger-menu-list-item-name').on('click', function() {
40      $(this).parent().toggleClass('block-header--hamburger-menu-list-item__active');
41    });
42    $('.block-header--hamburger-menu-sub-menu-list-item-name').on('click', function() {
43      $(this).parent().toggleClass('block-header--hamburger-menu-sub-menu-list-item__active');
44    });
45    $('.block-header--important-announce-close').on('click', function() {
46      $('.block-header--important-announce').hide();
47    });
48    $('.block-header--icon-menu-search-button').on('click', function() {
49      $('.block-header--search').toggle();
50      $('.block-header--search-container').toggle();
51      $('.block-header--search-input').focus();
52    });
53    
54    /* --- footer --- */
55    $('.block-footer--return').on('click', function() {
56      $('body, html').animate({ scrollTop: 0 }, 500);
57      return false;
58    });
59    
60    
61    $(document).ready(function(){
62      if($('body').hasClass('page-home')) {
63      } else if($('body').hasClass('page-product')) {
64        pageProductSet();
65        //cartInSet();
66      } else if($('body').hasClass('page-list')) {
67        pageListSet();
68        //cartInSet();
69        //colorSelctCartInSet();
70      } else if($('body').hasClass('page-information')) {
71        pageInformationSet();
72      } else if($('body').hasClass('page-topics-campaign')) {
73//        cartInSet();
74      } else if($('body').hasClass('page-ranking')) {
75        pageRankingSet();
76      } else if($('body').hasClass('page-cart')) {
77        orderMenuSet();
78      } else if($('body').hasClass('page-order')) {
79        pageOrderSet();
80        orderMenuSet();
81      } else if($('body').hasClass('page-order-confirmation')) {
82        pageOrderConfirmationSet();
83        orderMenuSet();
84      } else if($('body').hasClass('page-license-check')) {
85        pageLicenseCheckSet();
86      }
87      
88      pageLiposomeSet();
89      snsShareLinkSet();
90      tabChangeSet();
91      //accordionSet();
92      moreViewSet();
93      narrowDownSet();
94      pageScrollLinkSet();
95      checkBoxSet();
96      spinButtonSet();
97//      $('.js-modal.block-footer--mail-magazine-terms').hide();
98//      modalSet();
99//      modalSetRe();
100//      $('.js-modal-window').hide();
101//      $('.js-modal').hide();
102    });
103    
104    $(window).on('load', function() {
105      //mainContentMarginSet();
106      
107      /* --- slick --- */
108      $('.js-slick').slick({
109        autoplay: true,
110        arrow: true,
111        cssEase: 'ease-in-out',
112        dots: true,
113        dotsClass: 'js-slick--dots',
114        nextArrow: '<button class="js-slick--next js-slick--arrow" aria-label="Next" type="button">Next</button>',
115        prevArrow: '<button class="js-slick--prev js-slick--arrow" aria-label="Previous" type="button">Previous</button>',
116        speed: 1000
117      });
118      $('.js-slick-fade').slick({
119        arrows: false,
120        autoplay: true,
121        cssEase: 'ease-in-out',
122        fade: true,
123        speed: 1000
124      });
125      $('.js-slick-manual').slick({
126        autoplay: false,
127        arrow: true,
128        cssEase: 'ease-in-out',
129        dots: true,
130        dotsClass: 'js-slick--dots',
131        nextArrow: '<button class="js-slick--next js-slick--arrow" aria-label="Next" type="button">Next</button>',
132        prevArrow: '<button class="js-slick--prev js-slick--arrow" aria-label="Previous" type="button">Previous</button>',
133        speed: 1000
134      });
135      $('.js-slick__two-slides').slick({
136        autoplay: true,
137        arrow: true,
138        cssEase: 'ease-in-out',
139        dots: true,
140        dotsClass: 'js-slick--dots',
141        nextArrow: '<button class="js-slick--next js-slick--arrow" aria-label="Next" type="button">Next</button>',
142        prevArrow: '<button class="js-slick--prev js-slick--arrow" aria-label="Previous" type="button">Previous</button>',
143        slidesToShow: 2,
144        slidesToScroll: 2,
145        speed: 1000
146      });
147      $('.js-slick__two-slides-manual').slick({
148        autoplay: false,
149        arrow: true,
150        cssEase: 'ease-in-out',
151        dots: true,
152        dotsClass: 'js-slick--dots',
153        nextArrow: '<button class="js-slick--next js-slick--arrow" aria-label="Next" type="button">Next</button>',
154        prevArrow: '<button class="js-slick--prev js-slick--arrow" aria-label="Previous" type="button">Previous</button>',
155        slidesToShow: 2,
156        slidesToScroll: 2,
157        speed: 1000
158      });
159      $('.js-slick__three-slides-manual').slick({
160        autoplay: false,
161        arrow: true,
162        cssEase: 'ease-in-out',
163        dots: true,
164        dotsClass: 'js-slick--dots',
165        nextArrow: '<button class="js-slick--next js-slick--arrow" aria-label="Next" type="button">Next</button>',
166        prevArrow: '<button class="js-slick--prev js-slick--arrow" aria-label="Previous" type="button">Previous</button>',
167        slidesToShow: 3,
168        slidesToScroll: 3,
169        speed: 1000
170      });
171      $('.js-slick__five-slides-manual').slick({
172        autoplay: false,
173        arrow: true,
174        cssEase: 'ease-in-out',
175        dots: true,
176        dotsClass: 'js-slick--dots',
177        nextArrow: '<button class="js-slick--next js-slick--arrow" aria-label="Next" type="button">Next</button>',
178        prevArrow: '<button class="js-slick--prev js-slick--arrow" aria-label="Previous" type="button">Previous</button>',
179        slidesToShow: 5,
180        slidesToScroll: 5,
181        speed: 1000
182      });
183      $('.js-slick__six-slides-manual').slick({
184        autoplay: false,
185        arrow: true,
186        cssEase: 'ease-in-out',
187        dots: true,
188        dotsClass: 'js-slick--dots',
189        nextArrow: '<button class="js-slick--next js-slick--arrow" aria-label="Next" type="button">Next</button>',
190        prevArrow: '<button class="js-slick--prev js-slick--arrow" aria-label="Previous" type="button">Previous</button>',
191        slidesToShow: 6,
192        slidesToScroll: 6,
193        speed: 1000
194      });
195      
196      /* --- slick --- */
197      /*$('.block-detail--image-main-list').slick({
198        arrows: false,
199        autoplay: false,
200        dots: false,
201        fade: true,
202      });*/
203    });
204
205    /* --- スピンボタン --- */
206    var spinButtonSet = function() {
207      $('.common-input-number').append('<span class="common-input-number--up">up</span><span class="common-input-number--down">down</span>');
208      var up = $('.common-input-number').children('.common-input-number--up');
209      var down = $('.common-input-number').children('.common-input-number--down');
210      up.on('click', function() {
211        var counter =  $(this).parent('.common-input-number').children('input[type="number"]');
212        var num = Number(counter.val());
213        counter.val(num += 1);
214      });
215      down.on('click', function() {
216        var counter =  $(this).parent('.common-input-number').children('input[type="number"]');
217        var num = Number(counter.val());
218        if(1 < num) {
219          counter.val(num -= 1);
220        }
221      });
222    };
223    
224    /* --- モーダル表示 --- */
225    var modalSet = function() {
226      var windowHeight;
227      var boxHeight;
228      var windowWidth;
229      var boxWidth;
230      var modalSizeCheck = function() {
231        windowHeight = $(window).outerHeight();
232        boxHeight = $('.js-modal--main-container').outerHeight();
233        windowWidth = $(window).outerWidth();
234        boxWidth = $('.js-modal--main-container').outerWidth();
235      }
236      modalSizeCheck();
237      $('.js-modal').hide();
238      $('.js-modal-trigger').on('click', function() {
239        var name = $(this).attr('data-target');
240        var target = $('.js-modal.' + name);
241        $('.js-modal.' + name + ' .js-modal--main-container').css('top', ((windowHeight - boxHeight) / 2));
242        $('.js-modal.' + name + ' .js-modal--main-container').css('left', ((windowWidth - boxWidth) / 2));
243        $('.js-modal.' + name + ' .js-modal--close-button').css('top', (((windowHeight - boxHeight) / 2) + 20));
244        $('.js-modal.' + name + ' .js-modal--close-button').css('right', ((windowWidth - boxWidth) / 2) + 20);
245        target.fadeIn(400);
246        $(window).on('resize', function() {
247          modalSizeCheck();
248          $('.js-modal.' + name + ' .js-modal--main-container').css('top', ((windowHeight - boxHeight) / 2));
249          $('.js-modal.' + name + ' .js-modal--main-container').css('left', ((windowWidth - boxWidth) / 2));
250          $('.js-modal.' + name + ' .js-modal--close-button').css('top', (((windowHeight - boxHeight) / 2) + 20));
251          $('.js-modal.' + name + ' .js-modal--close-button').css('right', ((windowWidth - boxWidth) / 2) + 20);
252        });
253        $('.js-modal').on('click', function() {
254          target.fadeOut(400);
255        });
256        $('.js-modal--close-button').on('click', function() {
257          target.fadeOut(400);
258        });
259        $('.js-modal--main-container').on('click' , function(event) {
260          event.stopPropagation();
261        });
262      });
263    };
264    
265    /* --- モーダル表示 改修版 --- */
266    var modalSetRe = function() {
267      var target;
268      var targetBox;
269      var targetCloseButton;
270      var targetCheckBox;
271      var targetRadioButton;
272      var boxSizeSet = function() {
273        var windowHeight = target.outerHeight();
274        var boxHeight = targetBox.outerHeight();
275        var windowWidth = target.outerWidth();
276        var boxWidth = targetBox.outerWidth();
277        targetBox.css('top', ((windowHeight - boxHeight) / 2));
278        targetBox.css('left', ((windowWidth - boxWidth) / 2));
279      }
280      var modalClose = function() {
281        target.fadeOut(400, function() {
282          targetCloseButton.unwrap();
283          targetCloseButton.remove();
284          targetCheckBox.prop('checked', false);
285          targetRadioButton.prop('checked', false);
286        });
287      }
288      
289      $('.js-modal-window').hide();
290      $('body').on('click', '.js-modal-trigger', function() {
291        event.preventDefault();
292        
293        var name = $(this).attr('data-target');
294        target = $('.js-modal-window.' + name);
295        target.wrapInner('<div class="js-modal-window--main-container"></div>');
296        target.children('.js-modal-window--main-container').append('<div class="js-modal-window--close-button js-modal-window--close-trigger">close</div>');
297        targetBox = target.children('.js-modal-window--main-container');
298        targetCloseButton = targetBox.children('.js-modal-window--close-button');
299        targetCheckBox = targetBox.find('input[type="checkbox"]');
300        targetRadioButton = targetBox.find('input[type="radio"]');
301        
302        target.fadeIn(400);
303        boxSizeSet();
304        
305        $(window).on('resize', function() {
306          boxSizeSet();
307        });
308        target.on('click', function() {
309          modalClose();
310        });
311        $('.js-modal-window--close-trigger').on('click', function() {
312          modalClose();
313        });
314        targetBox.on('click', function(event) {
315          event.stopPropagation();
316        });
317      });
318    };
319    
320    /* --- モーダル表示 カート用 --- */
321    var cartInSet = function() {
322      var target;
323      var targetBox;
324      var targetCloseButton;
325      var targetCloseTrigger;
326      
327      var sceneResultA;
328      var sceneResultB;
329      var sceneResultC;
330      var nextButton;
331      var resetButton;
332      var cartButton;
333      var checks;
334      var check01;
335      var check02;
336      var check03;
337      var check04;
338      var check05;
339      var check06;
340      var sceneQuestion;
341
342
343      var boxSizeSet = function() {
344        var windowHeight = target.outerHeight();
345        var boxHeight = targetBox.outerHeight();
346        var windowWidth = target.outerWidth();
347        var boxWidth = targetBox.outerWidth();
348        targetBox.css('top', ((windowHeight - boxHeight) / 2));
349        targetBox.css('left', ((windowWidth - boxWidth) / 2));
350      }
351      var modalClose = function() {
352        target.fadeOut(400, function() {
353          targetCloseButton.unwrap();
354          targetCloseButton.remove();
355          sceneQuestion.hide();
356          checkerReset();
357        });
358      }
359      
360      
361      /* --- チェックボックスリセット --- */
362      var checkerReset = function() {
363        sceneResultA.hide();
364        sceneResultB.hide();
365        sceneResultC.hide();
366        checks.prop('checked', false);
367        nextButton.prop('disabled', true);
368      };
369      
370      $('.js-cart-in-window').hide();
371      $('.js-cart-in-trigger').on('click', function() {
372        event.preventDefault();
373        
374        var id = $(this).attr('data-target');
375        target = $('.js-cart-in-window[data-product-id="' + id +'"]');
376        target.wrapInner('<div class="js-cart-in-window--main-container"></div>');
377        target.children('.js-cart-in-window--main-container').append('<div class="js-cart-in-window--close-button js-cart-in-window--close-trigger">close</div>');
378        targetBox = target.children('.js-cart-in-window--main-container');
379        targetCloseButton = targetBox.children('.js-cart-in-window--close-button');
380        targetCloseTrigger = targetBox.find('.js-cart-in-window--close-trigger');
381        
382        sceneQuestion = targetBox.find('.block-modal-cart-check--question-scene');
383        sceneResultA = targetBox.find('.block-modal-cart-check--result-scene__a');
384        sceneResultB = targetBox.find('.block-modal-cart-check--result-scene__b');
385        sceneResultC = targetBox.find('.block-modal-cart-check--result-scene__c');
386        nextButton = targetBox.find('.block-modal-cart-check--next-button');
387        resetButton = targetBox.find('.block-modal-cart-check--reset-button');
388        cartButton = targetBox.find('.block-modal-cart-check--cart-button');
389        checks = targetBox.find('.block-modal-cart-check--question-check');
390        check01 = checks.eq(0);
391        check02 = checks.eq(1);
392        check03 = checks.eq(2);
393        check04 = checks.eq(3);
394        check05 = checks.eq(4);
395        check06 = checks.eq(5);
396
397        /* --- 初期表示 --- */
398        sceneQuestion.show();
399        checkerReset();
400        target.fadeIn(400);
401        boxSizeSet();
402        
403        /* --- モーダル機能 --- */
404        $(window).on('resize', function() {
405          boxSizeSet();
406        });
407        targetCloseTrigger.on('click', function() {
408          modalClose();
409        });
410        target.on('click', function() {
411          modalClose();
412        });
413        targetBox.on('click', function(event) {
414          event.stopPropagation();
415        });
416        
417        
418        /* --- 購入前カウンセリング --- */
419        checks.on('click', function() {
420          if(2 < $('.block-modal-cart-check--question-check:checked').length) {
421            nextButton.prop('disabled', false);
422          }
423        });
424        resetButton.on('click', function() {
425          checkerReset();
426          sceneQuestion.fadeIn(400, function() {
427            boxSizeSet();
428          });
429        });
430        nextButton.on('click', function() {
431          if(check02.prop('checked') && check04.prop('checked') && check06.prop('checked')) {
432            sceneQuestion.fadeOut(200);
433            sceneResultA.fadeIn(400, function() {
434              boxSizeSet();
435            });
436          } else if(check01.prop('checked')) {
437            sceneQuestion.fadeOut(200);
438            sceneResultB.fadeIn(400, function() {
439              boxSizeSet();
440            });
441          } else {
442            sceneQuestion.fadeOut(200);
443            sceneResultC.fadeIn(400, function() {
444              boxSizeSet();
445            });
446          }
447        });
448        cartButton.on('click', function() {
449          sceneResultB.fadeOut(200);
450          sceneResultC.fadeOut(200);
451          sceneResultA.fadeIn(400, function() {
452            boxSizeSet();
453          });
454        });
455      });
456    };
457
458    /* --- モーダル表示 色選択カート用 --- */
459    var colorSelctCartInSet = function() {
460      var target;
461      var targetBox;
462      var targetCloseButton;
463      var targetCloseTrigger;
464      
465      var sceneColorSelect;
466      var colorSelector;
467      var colorCurrent;
468      var colorList;
469      var colorSelectButton;
470      
471      var sceneResultA;
472      var sceneResultB;
473      var sceneResultC;
474      var nextButton;
475      var resetButton;
476      var cartButton;
477      var checks;
478      var check01;
479      var check02;
480      var check03;
481      var check04;
482      var check05;
483      var check06;
484      var sceneQuestion;
485
486
487      var boxSizeSet = function() {
488        var windowHeight = target.outerHeight();
489        var boxHeight = targetBox.outerHeight();
490        var windowWidth = target.outerWidth();
491        var boxWidth = targetBox.outerWidth();
492        targetBox.css('top', ((windowHeight - boxHeight) / 2));
493        targetBox.css('left', ((windowWidth - boxWidth) / 2));
494      }
495      var modalClose = function() {
496        target.fadeOut(400, function() {
497          targetCloseButton.unwrap();
498          targetCloseButton.remove();
499          sceneQuestion.hide();
500          checkerReset();
501        });
502      }
503      
504      
505      /* --- チェックボックスリセット --- */
506      var checkerReset = function() {
507        sceneResultA.hide();
508        sceneResultB.hide();
509        sceneResultC.hide();
510        checks.prop('checked', false);
511        nextButton.prop('disabled', true);
512      };
513      
514      $('.js-color-select-cart-in-window').hide();
515      $('.js-color-select-cart-in-trigger').on('click', function() {
516        event.preventDefault();
517        
518        var id = $(this).attr('data-target');
519        target = $('.js-color-select-cart-in-window[data-product-id="' + id +'"]');
520        target.wrapInner('<div class="js-color-select-cart-in-window--main-container"></div>');
521        target.children('.js-color-select-cart-in-window--main-container').append('<div class="js-color-select-cart-in-window--close-button js-color-select-cart-in-window--close-trigger">close</div>');
522        targetBox = target.children('.js-color-select-cart-in-window--main-container');
523        targetCloseButton = targetBox.children('.js-color-select-cart-in-window--close-button');
524        targetCloseTrigger = targetBox.find('.js-color-select-cart-in-window--close-trigger');
525        
526        sceneColorSelect = targetBox.find('.block-modal-
526cart-check--color-select-scene');
527        colorSelector = targetBox.find('.block-modal-cart-check--color-selector');
528        colorCurrent = targetBox.find('.block-modal-cart-check--color-selector-current-item');
529        colorList = targetBox.find('.block-modal-cart-check--color-selector-list');
530        colorSelectButton = targetBox.find('.block-modal-cart-check--color-select-button');
531        
532        sceneQuestion = targetBox.find('.block-modal-cart-check--question-scene');
533        sceneResultA = targetBox.find('.block-modal-cart-check--result-scene__a');
534        sceneResultB = targetBox.find('.block-modal-cart-check--result-scene__b');
535        sceneResultC = targetBox.find('.block-modal-cart-check--result-scene__c');
536        nextButton = targetBox.find('.block-modal-cart-check--next-button');
537        resetButton = targetBox.find('.block-modal-cart-check--reset-button');
538        cartButton = targetBox.find('.block-modal-cart-check--cart-button');
539        checks = targetBox.find('.block-modal-cart-check--question-check');
540        check01 = checks.eq(0);
541        check02 = checks.eq(1);
542        check03 = checks.eq(2);
543        check04 = checks.eq(3);
544        check05 = checks.eq(4);
545        check06 = checks.eq(5);
546
547        /* --- 初期表示 --- */
548        sceneColorSelect.show();
549        sceneQuestion.hide();
550        checkerReset();
551        target.fadeIn(400);
552        boxSizeSet();
553        
554        /* --- モーダル機能 --- */
555        $(window).on('resize', function() {
556          boxSizeSet();
557        });
558        targetCloseTrigger.on('click', function() {
559          modalClose();
560        });
561        target.on('click', function() {
562          modalClose();
563        });
564        targetBox.on('click', function(event) {
565          event.stopPropagation();
566        });
567        
568        
569        /* --- 色選択 --- */
570        colorCurrent.off('click');
571        colorCurrent.on('click', function() {
572          colorList.toggle();
573        });
574        colorList.children().on('click', function() {
575          colorList.hide();
576        });
577        colorSelector.on('mouseleave', function() {
578          colorList.hide();
579        });
580        colorSelectButton.on('click', function() {
581          sceneColorSelect.fadeOut(400);
582          sceneQuestion.fadeIn(400, function() {
583            boxSizeSet();
584          });
585        });
586        
587        
588        /* --- 購入前カウンセリング --- */
589        checks.on('click', function() {
590          if(2 < $('.block-modal-cart-check--question-check:checked').length) {
591            nextButton.prop('disabled', false);
592          }
593        });
594        resetButton.on('click', function() {
595          checkerReset();
596          sceneQuestion.fadeIn(400, function() {
597            boxSizeSet();
598          });
599        });
600        nextButton.on('click', function() {
601          if(check02.prop('checked') && check04.prop('checked') && check06.prop('checked')) {
602            sceneQuestion.fadeOut(200);
603            sceneResultA.fadeIn(400, function() {
604              boxSizeSet();
605            });
606          } else if(check01.prop('checked')) {
607            sceneQuestion.fadeOut(200);
608            sceneResultB.fadeIn(400, function() {
609              boxSizeSet();
610            });
611          } else {
612            sceneQuestion.fadeOut(200);
613            sceneResultC.fadeIn(400, function() {
614              boxSizeSet();
615            });
616          }
617        });
618        cartButton.on('click', function() {
619          sceneResultB.fadeOut(200);
620          sceneResultC.fadeOut(200);
621          sceneResultA.fadeIn(400, function() {
622            boxSizeSet();
623          });
624        });
625      });
626    };
627    
628    
629    /* --- 共通ラジオボタン --- */
630    var checkBoxSet = function() {
631      $('.common-input-radio-label').on('click', function() {
632        var check = $(this).children('.common-input-radio');
633        if(check.prop('checked')) {
634//          alert('yes');
635          check.prop('checked', false);
636          $(this).removeClass('common-input-radio-label__active');
637        } else {
638//          alert('no');
639          check.prop('checked', true);
640          $(this).addClass('common-input-radio-label__active');
641        }
642      });
643    };
644    /* --- 共通アコーディオン --- */
645    var accordionSet = function() {
646      $('.js-accordion-trigger').on('click', function() {
647        $(this).toggleClass('js-accordion-trigger__active');
648        $(this).next('.js-accordion-container').toggle();
649      });
650    };
651    /* --- 共通もっと見る --- */
652    var moreViewSet = function() {
653      var target;
654      $('.js-more-view-trigger').on('click', function() {
655        target = $(this).attr('data-target');
656        $(this).toggleClass('js-more-view-trigger__active');
657        $('.js-more-view-container.' + target).toggle();
658      });
659    };
660    /* --- 共通絞り込み(select利用) --- */
661    var narrowDownSet = function() {
662      var narrowDownTarget;
663      var target = $('.js-narrow-down-select').attr('data-target');
664      $('.js-narrow-down-select').on('change', function() {
665        narrowDownTarget = $(this).children('option:selected').val();
666        $('.js-narrow-down-target-container.' + target).children().hide();
667        $('.js-narrow-down-target-container.' + target).children('.' +  narrowDownTarget).show();
668      });
669    };
670    
671    /* --- 共通ページ内リンクスクロール --- */
672    var pageScrollLinkSet = function() {
673      var target;
674      var targetPosition;
675      $('.js-page-scroll').on('click', function() {
676        target = $(this).attr('data-target');
677        targetPosition = $('.' + target).offset().top - 100;
678        $('body, html').animate({ scrollTop: targetPosition }, 400);
679        return false;
680      });
681    }
682    
683    /* --- 共通タブ切り替え --- */
684    var tabChangeSet = function() {
685      $('.js-tab-area > *:not(.js-tab-area--item__active)').hide();
686      $('.js-tab > *').on('click', function() {
687        var name = $(this).parent('.js-tab').attr('data-target');
688        var targets = $('.js-tab-area.' + name).children();
689        var tabs = $(this).parent('.js-tab').children();
690        var index = tabs.index(this);
691        tabs.removeClass('js-tab--item__active');
692        $(this).addClass('js-tab--item__active');
693        targets.hide().removeClass('js-tab-area--item__active');
694        targets.eq(index).show().addClass('js-tab-area--item__active');
695        if(targets.eq(index).hasClass('js-slick__two-slides')) {
696          targets.eq(index).slick('setPosition').slick('slickGoTo', 0, false).slick('slickPlay');
697        }
698      });
699    };
700    /* --- 共通シェアリンク設定 --- */
701    var snsShareLinkSet = function() {
702      var thisUrl = $(location).attr('href');
703      var encodeUrl = encodeURIComponent(thisUrl);
704      var linkFb = 'https://www.facebook.com/share.php?u=' + thisUrl;
705      //var linkTw = 'http://twitter.com/share?text=' + '【ツイート文(日本語が含まれる場合にはURLエンコードが必要)】' + '&url=' + '【共有するURL】' + '&hashtags=' + '【ハッシュタグ(複数あるときはカンマ区切り)】';
706      var linkTw = 'https://twitter.com/share?url=' + thisUrl;
707      var linkLine = 'https://social-plugins.line.me/lineit/share?url=' + encodeUrl;
708      $('.block-header--icon-menu-list-item-anchor__facebook').attr('href', linkFb);
709      $('.block-header--icon-menu-list-item-anchor__twitter').attr('href', linkTw);
710      $('.block-header--icon-menu-list-item-anchor__line').attr('href', linkLine);
711    };
712    
713    
714    /* --- page-information INFORMATIONトピックス一覧用 --- */
715    var pageInformationSet = function() {
716      var targetPosition;
717      $('.block-news-nav--list-item__product').on('click', function() {
718        targetPosition = $('.block-news--product').offset().top - 60;
719        $('body, html').animate({ scrollTop: targetPosition }, 400);
720        return false;
721      });
722      $('.block-news-nav--list-item__campaign').on('click', function() {
723        targetPosition = $('.block-news--campaign').offset().top - 60;
724        $('body, html').animate({ scrollTop: targetPosition }, 400);
725        return false;
726      });
727      $('.block-news-nav--list-item__information').on('click', function() {
728        targetPosition = $('.block-news--information').offset().top - 60;
729        $('body, html').animate({ scrollTop: targetPosition }, 400);
730        return false;
731      });
732      
733      $('.block-news--product').attr('id', 'product');
734      $('.block-news--campaign').attr('id', 'campaign');
735      $('.block-news--information').attr('id', 'information');
736    }
737    
738    /* --- page-ranking ランキング用 --- */
739    var pageRankingSet = function() {
740      var targetPosition;
741      $('.block-ranking-nav--list-item__skincare').on('click', function() {
742        targetPosition = $('.block-ranking__skincare').offset().top - 150;
743        $('body, html').animate({ scrollTop: targetPosition }, 400);
744        return false;
745      });
746      $('.block-ranking-nav--list-item__basemake').on('click', function() {
747        targetPosition = $('.block-ranking__basemake').offset().top - 150;
748        $('body, html').animate({ scrollTop: targetPosition }, 400);
749        return false;
750      });
751      $('.block-ranking-nav--list-item__pointmake').on('click', function() {
752        targetPosition = $('.block-ranking__pointmake').offset().top - 150;
753        $('body, html').animate({ scrollTop: targetPosition }, 400);
754        return false;
755      });
756    }
757    
758    /* --- page-productme-top リポソームライントップ用 --- */
759    var pageLiposomeSet = function() {
760      var targetPosition;
761      $('.block-line--page-nav-item__concept').on('click', function() {
762        targetPosition = $('.block-line--concept-detail').offset().top - 150;
763        $('body, html').animate({ scrollTop: targetPosition }, 400);
764        return false;
765      });
766      $('.block-line--page-nav-item__review').on('click', function() {
767        targetPosition = $('.block-line--review').offset().top - 150;
768        $('body, html').animate({ scrollTop: targetPosition }, 400);
769        return false;
770      });
771      $('.block-line--page-nav-item__products').on('click', function() {
772        targetPosition = $('.block-list').offset().top - 150;
773        $('body, html').animate({ scrollTop: targetPosition }, 400);
774        return false;
775      });
776    }
777    
778    /* --- page-list 商品一覧専用 --- */
779    var pageListSet = function() {
780    
781      /* --- page-list 一覧表示形式変更 --- */
782      var listFormatSet = function() {
783        var listButton = $('.block-list--list-format-list-button');
784        var gridButton = $('.block-list--list-format-grid-button');
785        var list =$('.block-list--list-frame');
786        listButton.on('click', function() {
787          $(this).addClass('block-list--list-format-list-button__active');
788          gridButton.removeClass('block-list--list-format-grid-button__active');
789          list.addClass('block-list--list-frame__list');
790          list.removeClass('block-list--list-frame__grid');
791        })
792        gridButton.on('click', function() {
793          $(this).addClass('block-list--list-format-grid-button__active');
794          listButton.removeClass('block-list--list-format-list-button__active');
795          list.addClass('block-list--list-frame__grid');
796          list.removeClass('block-list--list-frame__list');
797        })
798      };
799      
800      /* --- page-list 一覧サイドメニュー位置 --- */
801/*      var listSideMenuPositionSet = function() {
802        var menu = $('.block-list-side-menu');
803        var firstPosition = menu.offset().top;
804        var scroll;
805        $(window).on('scroll', function(){
806          scroll = $(window).scrollTop();
807          if((firstPosition + 230) < scroll) {
808            menu.css({
809              'position' : 'fixed',
810              'top' : 0
811            });
812          }
813        });
814      };*/
815      
816      /* --- page-list 絞り込みメニューアコーディオン --- */
817      var narrowDownMenuSet = function() {
818        $('.block-list--list-narrow-down').on('click', function() {
819          $(this).toggleClass('block-list--list-narrow-down__active');
820          $(this).next('.block-list--list-narrow-down-menu').toggle();
821        })
822        $('.block-list--list-narrow-down-menu-reset-button').on('click', function() {
823          $('.block-list--list-narrow-down-menu-narrow-radio-list-item-button').prop('checked', false);
824        });
825      };
826      
827      var narrowDownMenuButtonSet = function() {
828        if($('.block-list--list-narrow-down-menu').length) {
829          var menu = $('.block-list--list-narrow-down-menu');
830          var menuStartPosition;
831          var menuEndPosition;
832          var currentPosition;
833          
834          var positionSet = function() {
835            menuStartPosition = menu.offset().top + 140;
836            menuEndPosition = menu.offset().top + menu.innerHeight();
837            currentPosition = $(window).scrollTop() + $(window).outerHeight();
838            if((menuStartPosition < currentPosition) && (currentPosition < menuEndPosition)) {
839              $('.block-list--list-narrow-down-menu-button-area').addClass('block-list--list-narrow-down-menu-button-area__fixed');
840            } else {
841              $('.block-list--list-narrow-down-menu-button-area').removeClass('block-list--list-narrow-down-menu-button-area__fixed');
842            }
843          };
844
845          $(window).on('scroll', function() {
846            positionSet();
847          });
848          $('.js-accordion-trigger').on('click', function() {
849            setTimeout(function(){
850              positionSet();
851            }, 10);
852          });
853        }
854      };
855      
856      /* --- page-list その他リンクメニューアコーディオン --- */
857      var otherMenuSet = function() {
858        $('.block-list--other-menu-trigger__categroy').on('click', function() {
859          $('.block-other-menu__category').toggleClass('block-other-menu__active');
860        })
861        $('.block-list--other-menu-trigger__purpose').on('click', function() {
862          $('.block-other-menu__purpose').toggleClass('block-other-menu__active');
863        })
864        $('.block-other-menu--sub-link-list').hide();
865        $('.block-other-menu--link-list-item-name').on('click', function() {
866          $(this).toggleClass('block-other-menu--link-list-item-name__active');
867          $(this).next('.block-other-menu--sub-link-list').toggle();
868        });
869        $('.block-other-menu--close-trigger').on('click', function() {
870          $(this).parents('.block-other-menu').toggleClass('block-other-menu__active');
871        })
872      };
873      
874      /* --- page-list 一覧サイドメニューアコーディオン --- */
875      var listSideMenuAccordionSet = function() {
876/*        $('.block-list--side-menu-link-list-item-name').on('click', function() {
877          $(this).toggleClass('block-list--side-menu-link-list-item-name__active');
878          $(this).next('.block-list--side-menu-sub-link-list').toggle();
879        });*/
880/*        $('.block-list--side-menu-line-group-title').on('click', function() {
881          $(this).toggleClass('block-list--side-menu-line-group-title__active');
882          $(this).next('.block-list--side-menu-check-area').toggle();
883        });*/
884      };
885      
886      /* --- page-list 一覧サイドメニューチェックリセット --- */
887      var listSideMenuCheckSet = function() {
888        $('.block-list--side-menu-narrow-reset-button').on('click', function() {
889          $('.block-list--side-menu-narrow-list-item-button').prop('checked', false)
890        });
891      };
892      
893      /* --- 色玉変更切り替え --- */
894      var colorChangeSet = function() {
895        var triggers = $('.js-change-trigger');
896        var targets = $('.js-change-target');
897        var targetId;
898        var reset = function() {
899          triggers.removeClass('js-change-trigger__active');
900          targets.removeClass('js-change-target__active');
901          targets.hide();
902        };
903        targets.hide();
904        $('.js-change-target__active').show();
905        $(triggers).on('click', function() {
906          targetId = $(this).attr('data-target');
907          reset();
908          $('.js-change-trigger[data-target=' + targetId + ']').addClass('js-change-trigger__active')
909          $('.js-change-target[data-color-id=' + targetId + ']').show().addClass('js-change-target__active');
910        });
911      };
912      
913      listFormatSet();
914      //listSideMenuPositionSet();
915      listSideMenuAccordionSet();
916      listSideMenuCheckSet();
917      narrowDownMenuSet();
918      narrowDownMenuButtonSet();
919      otherMenuSet();
920      colorChangeSet();
921    };
922    
923    
924    /* --- page-product 商品専用 --- */
925    var pageProductSet = function() {
926      /* --- page-product PC商品サムネイル用スライド --- */
927      $('.block-detail--image-thumbnail-list').slick({
928        arrows: true,
929        //asNavFor: '.block-detail--image-main-list',
930        autoplay: false,
931        dots: false,
932        infinite: false,
933        slidesToScroll: 1,
934        slidesToShow: 4,
935        vertical: true,
936        nextArrow: '<button class="block-detail--image-thumbnail-list-arrow block-detail--image-thumbnail-list-next" aria-label="Next" type="button">Next</button>',
937        prevArrow: '<button class="block-detail--image-thumbnail-list-arrow block-detail--image-thumbnail-list-prev" aria-label="Previous" type="button">Previous</button>',
938      });
939      /* --- page-product SP商品メイン画像用スライド --- */
940      $('.block-detail--image-list').slick({
941        autoplay: false,
942        arrow: true,
943        cssEase: 'ease-in-out',
944        dots: true,
945        dotsClass: 'block-detail--image-list-dots',
946        nextArrow: '<button class="block-detail--image-list-arrow block-detail--image-list-next" aria-label="Next" type="button">Next</button>',
947        prevArrow: '<button class="block-detail--image-list-arrow block-detail--image-list-prev" aria-label="Previous" type="button">Previous</button>',
948      });
949      /* --- page-product 色玉用スライド --- */
950      $('.block-detail--color-slide-list').slick({
951        arrows: true,
952        autoplay: false,
953        dots: false,
954        slidesToScroll: 6,
955        slidesToShow: 6,
956        nextArrow: '<button class="block-detail--color-slide-list-arrow block-detail--color-slide-list-next" aria-label="Next" type="button">Next</button>',
957        prevArrow: '<button class="block-detail--color-slide-list-arrow block-detail--color-slide-list-prev" aria-label="Previous" type="button">Previous</button>',
958      });
959      
960      /* --- 色玉変更切り替え --- */
961      var colorChangeSet = function() {
962        var triggers = $('.js-change-trigger');
963        var targets = $('.js-change-target');
964        var targetId;
965        var reset = function() {
966          triggers.removeClass('js-change-trigger__active');
967          targets.removeClass('js-change-target__active');
968          targets.hide();
969        };
970        targets.hide();
971        $('.js-change-target__active').show();
972        $(triggers).on('click', function() {
973          targetId = $(this).attr('data-target');
974          reset();
975          $('.js-change-trigger[data-target=' + targetId + ']').addClass('js-change-trigger__active')
976          $('.js-change-target[data-color-id=' + targetId + ']').show().addClass('js-change-target__active');
977          $('.block-detail--image-thumbnail-list').slick('setPosition');
978          $('.block-detail--image-list').slick('setPosition');
979          imageChangeSet();
980        });
981      };
982      
983      /* --- page-product サムネイル連動メイン画像変更 --- */
984      var imageChangeSet = function() {
985        var thumbnail = $('.js-change-target__active > .block-detail--image-thumbnail-list .block-detail--image-thumbnail-list-item');
986        var main = $('.js-change-target__active > .block-detail--image-main-list > .block-detail--image-main-list-item');
987        main.hide();
988        main.eq(0).show();
989        $(thumbnail).off('click');
990        $(thumbnail).on('click', function() {
991          var num = $(this).index();
992          main.hide();
993          main.eq(num).fadeIn();
994        });
995      };
996      
997      /* --- page-product シェアボタン表示 --- */
998      var shareButtonSet = function() {
999        $('.block-detail--share-button').on('click', function() {
1000          $('.block-detail--share-list').toggle();
1001        });
1002      };
1003      /* --- page-product 刻印チェックアコーディオン --- */
1004      var engravedAccordionSet = function() {
1005        $('.block-detail--engraved-check > input[type="checkbox"]').on('click', function() {
1006          if($(this).prop("checked")) {
1007            $('.block-detail--engraved-setting').show();
1008          } else {
1009            $('.block-detail--engraved-setting').hide();
1010          }
1011        });
1012      };
1013      /* --- お気に入りボタン --- */
1014      var favoCheckSet = function() {
1015        $('.common-favo-label').on('click', function() {
1016          var label = $('.common-favo-label');
1017          if($('.common-favo-check').prop('checked')) {
1018//            alert('yes');
1019            $('input[id="common_favo_check"]').prop('checked', false);
1020            label.removeClass('common-favo-label__active');
1021          } else {
1022//            alert('no');
1023            $('input[id="common_favo_check"]').prop('checked', true);
1024            label.addClass('common-favo-label__active');
1025          }
1026        });
1027      };
1028      
1029      /* --- 色玉セレクター PC用 --- */
1030      var colorSelectorSet = function() {
1031        var selector = $('.block-detail--color-selector');
1032        var trigger = $('.block-detail--color-selector-current-item');
1033        var selectList = $('.block-detail--color-selector-list');
1034        selector.on('mouseleave', function() {
1035          selectList.hide();
1036        });
1037        trigger.on('click', function() {
1038          selectList.toggle();
1039        });
1040      };
1041      /* --- 色玉セレクター SPフロートメニュー用 --- */
1042      var cartMenuColorSelectorSet = function() {
1043        var selector = $('.block-cart-menu--color-selector');
1044        var trigger = $('.block-cart-menu--color-selector-current-item');
1045        var selectList = $('.block-cart-menu--color-selector-list');
1046        selector.on('mouseleave', function() {
1047          selectList.hide();
1048        });
1049        trigger.on('click', function() {
1050          selectList.toggle();
1051        });
1052        $('.block-cart-menu--color-selector-list-item').on('click', function() {
1053          selectList.toggle();
1054        });
1055      };
1056      /* --- サイズセレクター SPフロートメニュー用 --- */
1057      var cartMenuSizeSelectorSet = function() {
1058        var selector = $('.block-cart-menu--size-selector');
1059        var trigger = $('.block-cart-menu--size-selector-current-item');
1060        var selectList = $('.block-cart-menu--size-selector-list');
1061        selector.on('mouseleave', function() {
1062          selectList.hide();
1063        });
1064        trigger.on('click', function() {
1065          selectList.toggle();
1066        });
1067        $('.block-cart-menu--size-selector-list-item').on('click', function() {
1068          selectList.toggle();
1069        });
1070      };
1071      
1072      /* --- SPフロートメニュー用 --- */
1073      var cartMenuPositionSet = function() {
1074        if($('.block-cart-menu').length) {
1075          var menu = $('.block-cart-menu');
1076          var menuStartPosition = $('.block-detail--copy').offset().top + menu.outerHeight();
1077          var menuEndPosition;
1078          var currentPosition;
1079          var selectColorList = $('.block-cart-menu--color-selector-list');
1080          var selectSizeList = $('.block-cart-menu--size-selector-list');
1081
1082          menu.css('bottom', -(menu.outerHeight()));
1083
1084          $(window).on('scroll', function() {
1085//            menuEndPosition = $('.block-recommend').offset().top  + menu.outerHeight();
1086            menuEndPosition = $('.block-review').offset().top  + menu.outerHeight();
1087            currentPosition = $(window).scrollTop() + $(window).height();
1088    //        alert($('.block-action').height());
1089            if(currentPosition < menuStartPosition) {
1090              menu.css('bottom', -(menu.outerHeight()));
1091              selectColorList.hide();
1092              selectSizeList.hide();
1093            } else if((menuStartPosition < currentPosition) && (currentPosition < menuEndPosition)) {
1094              menu.css('bottom', 0);
1095            } else {
1096              menu.css('bottom', -(menu.outerHeight()));
1097              selectColorList.hide();
1098              selectSizeList.hide();
1099            }
1100          });
1101        }
1102      }      
1103      
1104      colorSelectorSet();
1105      cartMenuColorSelectorSet();
1106      cartMenuSizeSelectorSet();
1107      colorChangeSet();
1108      imageChangeSet();
1109      engravedAccordionSet();
1110      shareButtonSet();
1111      //favoCheckSet();
1112      cartMenuPositionSet();
1113    };
1114    
1115    /* --- 注文ページ右メニュー --- */
1116    var orderMenuSet = function() {
1117      if($('.block-action').length) {
1118        var menu = $('.block-action--container');
1119        var menuStartPosition = $('.block-action').offset().top;
1120        var menuEndPosition;
1121        var currentPosition;
1122      
1123        $(window).on('scroll', function() {
1124          menuEndPosition = $('.block-action').offset().top + $('.block-action').height() - menu.outerHeight();
1125          currentPosition = $(window).scrollTop();
1126  //        alert($('.block-action').height());
1127          if(currentPosition < (menuStartPosition - 99)) {
1128            menu.css('position', 'relative');
1129            menu.css('top', '0');
1130          } else if(((menuStartPosition - 100) < currentPosition) && (currentPosition < (menuEndPosition - 180))) {
1131            menu.css('position', 'fixed');
1132            menu.css('top', '100px');
1133          } else {
1134            menu.css('position', 'relative');
1135            menu.css('top', ($('.block-action').height() - menu.outerHeight() - 80));
1136          }
1137        });
1138      }
1139    }
1140    
1141    /* --- page-order 注文指定 --- */
1142    var pageOrderSet = function() {
1143      
1144      /* --- モーダル表示 ラッピング選択 --- */
1145      var wrappingSelectSet = function() {
1146        var target;
1147        var targetBox;
1148        var targetCloseButton;
1149        var targetCloseTrigger;
1150
1151        var sceneFirst;
1152        var sceneSecond;
1153        var sceneThird;
1154        var sceneThirdAll;
1155        var moveFirstTrigger;
1156        var moveSecondTrigger;
1157        var moveThirdTrigger;
1158        var moveThirdAllTrigger;
1159        
1160        var wrappingMessageSettingArea;
1161
1162        var boxSizeSet = function() {
1163          var windowHeight = target.outerHeight();
1164          var boxHeight = targetBox.outerHeight();
1165          var windowWidth = target.outerWidth();
1166          var boxWidth = targetBox.outerWidth();
1167          targetBox.css('top', ((windowHeight - boxHeight) / 2));
1168          targetBox.css('left', ((windowWidth - boxWidth) / 2));
1169        }
1170        var modalClose = function() {
1171          target.fadeOut(400, function() {
1172            targetCloseButton.unwrap();
1173            targetCloseButton.remove();
1174            sceneFirst.hide();
1175            sceneSecond.hide();
1176            sceneSecond.find('input[type="radio"]').prop('checked', false);
1177            sceneThird.hide();
1178            sceneThird.find('input[type="checkbox"]').prop('checked', false);
1179            sceneThird.find('input[type="radio"]').prop('checked', false);
1180            sceneThirdAll.hide();
1181            sceneThirdAll.find('input[type="checkbox"]').prop('checked', false);
1182            sceneThirdAll.find('input[type="radio"]').prop('checked', false);
1183            wrappingMessageSettingArea.show();
1184          });
1185        }
1186        
1187        /* --- ラッピングメッセージチェックアコーディオン --- */
1188        var wrappingMessageAccordionSet = function() {
1189          $('.block-modal-wrapping-select--message-check > input[type="checkbox"]').on('click', function() {
1190            if($(this).prop("checked")) {
1191              wrappingMessageSettingArea.show();
1192              boxSizeSet();
1193            } else {
1194              wrappingMessageSettingArea.hide();
1195              boxSizeSet();
1196            }
1197          });
1198        };
1199
1200
1201        $('.js-wrapping-select-window').hide();
1202        $('.js-wrapping-select-trigger').on('click', function() {
1203          event.preventDefault();
1204
1205          target = $('.js-wrapping-select-window');
1206          target.wrapInner('<div class="js-wrapping-select-window--main-container"></div>');
1207          target.children('.js-wrapping-select-window--main-container').append('<div class="js-wrapping-select-window--close-button js-wrapping-select-window--close-trigger">close</div>');
1208          targetBox = target.children('.js-wrapping-select-window--main-container');
1209          targetCloseButton = targetBox.children('.js-wrapping-select-window--close-button');
1210          targetCloseTrigger = targetBox.find('.js-wrapping-select-window--close-trigger');
1211
1212          sceneFirst = targetBox.find('.block-modal-wrapping-select--first-scene');
1213          sceneSecond = targetBox.find('.block-modal-wrapping-select--second-scene');
1214          sceneThird = targetBox.find('.block-modal-wrapping-select--third-scene__some');
1215          sceneThirdAll = targetBox.find('.block-modal-wrapping-select--third-scene__all');
1216          
1217          moveFirstTrigger = targetBox.find('.block-modal-wrapping-select--move-trigger__first');
1218          moveSecondTrigger = targetBox.find('.block-modal-wrapping-select--move-trigger__second');
1219          moveThirdTrigger = targetBox.find('.block-modal-wrapping-select--move-trigger__third-some');
1220          moveThirdAllTrigger = targetBox.find('.block-modal-wrapping-select--move-trigger__third-all');
1221
1222          wrappingMessageSettingArea = $('.block-modal-wrapping-select--message-setting');
1223
1224
1225          /* --- 初期表示 --- */
1226          sceneFirst.show();
1227          sceneSecond.hide();
1228          sceneThird.hide();
1229          sceneThirdAll.hide();
1230          target.fadeIn(400);
1231          wrappingMessageSettingArea.hide();
1232          wrappingMessageAccordionSet();
1233          boxSizeSet();
1234
1235          /* --- モーダル機能 --- */
1236          $(window).on('resize', function() {
1237            boxSizeSet();
1238          });
1239          targetCloseTrigger.on('click', function() {
1240            modalClose();
1241          });
1242          target.on('click', function() {
1243            modalClose();
1244          });
1245          targetBox.on('click', function(event) {
1246            event.stopPropagation();
1247          });
1248          
1249          $(moveFirstTrigger).on('click', function() {
1250            sceneSecond.fadeOut(400, function() {
1251              sceneSecond.find('input[type="radio"]').prop('checked', false);
1252            });
1253            sceneThird.fadeOut(400, function() {
1254              sceneThird.find('input[type="checkbox"]').prop('checked', false);
1255              sceneThird.find('input[type="radio"]').prop('checked', false);
1256              wrappingMessageSettingArea.hide();
1257            });
1258            sceneThirdAll.fadeOut(400, function() {
1259              sceneThirdAll.find('input[type="checkbox"]').prop('checked', false);
1260              sceneThirdAll.find('input[type="radio"]').prop('checked', false);
1261              wrappingMessageSettingArea.hide();
1262            });
1263            sceneFirst.fadeIn(400, function() {
1264              boxSizeSet();
1265            });
1266          });
1267          $(moveSecondTrigger).on('click', function() {
1268            sceneFirst.fadeOut(400);
1269            sceneThird.fadeOut(400, function() {
1270              sceneThird.find('input[type="radio"]').prop('checked', false);
1271              wrappingMessageSettingArea.hide();
1272            });
1273            sceneSecond.fadeIn(400, function() {
1274              boxSizeSet();
1275            });
1276          });
1277          $(moveThirdTrigger).on('click', function() {
1278            sceneSecond.fadeOut(400);
1279            sceneThird.fadeIn(400, function(){
1280              boxSizeSet();
1281            });
1282          });
1283          $(moveThirdAllTrigger).on('click', function() {
1284            sceneFirst.fadeOut(400);
1285            sceneThirdAll.fadeIn(400, function() {
1286              boxSizeSet();
1287            });
1288          });
1289        });
1290      };
1291      
1292      wrappingSelectSet();
1293    }
1294    
1295    /* --- page-order 注文確認 --- */
1296    var pageOrderConfirmationSet = function() {
1297      
1298      /* --- カード選択表示切替 --- */
1299      var cardTypeChangeSet = function() {
1300        var flagRegistered = $('.block-confirmation--card-type-input__registered');
1301        var flagNew = $('.block-confirmation--card-type-input__new');
1302        var flagRegisteredSp = $('.block-confirmation--payment-method-card-type-input__registered');
1303        var flagNewSp = $('.block-confirmation--payment-method-card-type-input__new');
1304        var registeredArea = $('.block-confirmation--card-registered-list');
1305        var newArea =$('.block-confirmation--card-new-area');
1306        
1307        newArea.hide();
1308        flagRegistered.on('change', function() {
1309          if(flagRegistered.prop('checked')) {
1310            newArea.hide();
1311            registeredArea.show();
1312          }
1313        });
1314        flagNew.on('change', function() {
1315          if(flagNew.prop('checked')) {
1316            registeredArea.hide();
1317            registeredArea.find('input[type="radio"]').prop('checked', false);
1318            newArea.show();
1319          }
1320        });
1321        flagRegisteredSp.on('change', function() {
1322          if(flagRegisteredSp.prop('checked')) {
1323            newArea.hide();
1324            registeredArea.show();
1325          }
1326        });
1327        flagNewSp.on('change', function() {
1328          if(flagNewSp.prop('checked')) {
1329            registeredArea.hide();
1330            registeredArea.find('input[type="radio"]').prop('checked', false);
1331            newArea.show();
1332          }
1333        });
1334      };
1335      
1336      /* --- モーダル表示 お届け先選択 --- */
1337      var addressSelectSet = function() {
1338        var target;
1339        var targetBox;
1340        var targetCloseButton;
1341        var targetCloseTrigger;
1342        var newTrigger = $('.block-modal-address-select--new-button');
1343        var editTrigger = $('.block-modal-address-select--address-edit-trigger');
1344        var newArea = $('.block-modal-address-select--new-area');
1345        var editArea = $('.block-modal-address-select--edit-area');
1346
1347        var boxSizeSet = function() {
1348          var windowHeight = target.outerHeight();
1349          var boxHeight = targetBox.outerHeight();
1350          var windowWidth = target.outerWidth();
1351          var boxWidth = targetBox.outerWidth();
1352          targetBox.css('top', ((windowHeight - boxHeight) / 2));
1353          targetBox.css('left', ((windowWidth - boxWidth) / 2));
1354        }
1355        var modalClose = function() {
1356          target.fadeOut(400, function() {
1357            targetCloseButton.unwrap();
1358            targetCloseButton.remove();
1359            newArea.hide();
1360            editArea.hide();
1361          });
1362        }
1363
1364        $('.js-address-select-window').hide();
1365        $('.js-address-select-trigger').on('click', function() {
1366          event.preventDefault();
1367
1368          target = $('.js-address-select-window');
1369          target.wrapInner('<div class="js-address-select-window--main-container"></div>');
1370          target.children('.js-address-select-window--main-container').append('<div class="js-address-select-window--close-button js-address-select-window--close-trigger">close</div>');
1371          targetBox = target.children('.js-address-select-window--main-container');
1372          targetCloseButton = targetBox.children('.js-address-select-window--close-button');
1373          targetCloseTrigger = targetBox.find('.js-address-select-window--close-trigger');
1374          newTrigger = targetBox.find('.block-modal-address-select--new-button');
1375          editTrigger = targetBox.find('.block-modal-address-select--address-edit-trigger');
1376          newArea = targetBox.find('.block-modal-address-select--new-area');
1377          editArea = targetBox.find('.block-modal-address-select--edit-area');
1378
1379
1380          /* --- 初期表示 --- */
1381          newArea.hide();
1382          editArea.hide();
1383          target.fadeIn(400);
1384          boxSizeSet();
1385
1386          /* --- モーダル機能 --- */
1387          $(window).on('resize', function() {
1388            boxSizeSet();
1389          });
1390          targetCloseTrigger.on('click', function() {
1391            modalClose();
1392          });
1393          target.on('click', function() {
1394            modalClose();
1395          });
1396          targetBox.on('click', function(event) {
1397            event.stopPropagation();
1398          });
1399          
1400          /* --- お届け先編集表示切替 --- */
1401          newTrigger.on('click', function() {
1402            editArea.hide();
1403            newArea.show();
1404            boxSizeSet();
1405          });
1406          editTrigger.on('click', function() {
1407            newArea.hide();
1408            editArea.show();
1409            boxSizeSet();
1410          });
1411        });
1412      };
1413      
1414      cardTypeChangeSet();
1415      addressSelectSet();
1416    };
1417    
1418    /* --- page-license-check 用 --- */
1419    var pageLicenseCheckSet = function() {
1420      var checks = $('.block-license-check--question-check');
1421      var nextButton = $('.block-license-check--next-button');
1422      var checkerReset = function() {
1423        checks.prop('checked', false);
1424        nextButton.prop('disabled', true);
1425      };
1426
1427      checkerReset();
1428      checks.on('click', function() {
1429        if(2 < $('.block-license-check--question-check:checked').length) {
1430          nextButton.prop('disabled', false);
1431        }
1432      });
1433      $('.block-license-check--reset-button').on('click', function() {
1434        checkerReset();
1435      });
1436    }
1437    
1438
1439  });
1440}(jQuery, window));
1441
1442
1443
1444
1445
1446
1447

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.