var TabBlock = { s: { animLen: 200 }, init: function() { TabBlock.bindUIActions(); TabBlock.hideInactive(); }, bindUIActions: function() { $('.tabBlock-tabs').on('click', '.tabBlock-tab', function(){ TabBlock.switchTab($(this)); }); }, hideInactive: function() { var $tabBlocks = $('.tabBlock'); $tabBlocks.each(function(i) { var $tabBlock = $($tabBlocks[i]), $panes = $tabBlock.find('.tabBlock-pane'), $activeTab = $tabBlock.find('.tabBlock-tab.is-active'); $panes.hide(); $($panes[$activeTab.index()]).show(); }); }, switchTab: function($tab) { var $context = $tab.closest('.tabBlock'); if (!$tab.hasClass('is-active')) { $tab.siblings().removeClass('is-active'); $tab.addClass('is-active'); TabBlock.showPane($tab.index(), $context); } }, showPane: function(i, $context) { var $panes = $context.find('.tabBlock-pane'); $panes.slideUp(TabBlock.s.animLen); $($panes[i]).slideDown(TabBlock.s.animLen); } }; $(function() { TabBlock.init(); $("#moreCategory").click(function () { if ($(this).html() == 'もっと見る') { $(this).html('閉じる'); $('.tabBlock-pane ul').css({ 'height': 'auto', 'overflow': 'auto' }); } else { $(this).html('もっと見る'); $('.tabBlock-pane ul').removeAttr('style'); } }); }); var best = new Swiper('#best', { slidesPerView: 5, slidesPerColumn: 2, paginationClickable: true, slidesPerColumnFill: 'column', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 3, } } }); var newb = new Swiper('#newb', { slidesPerView: 5, slidesPerColumn: 2, paginationClickable: true, slidesPerColumnFill: 'column', pagination: '.swiper-pagination-newb', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 3, } } }); var newss = new Swiper('#newss', { slidesPerView: 5, slidesPerColumn: 2, paginationClickable: true, slidesPerColumnFill: 'column', pagination: '.swiper-pagination-newss', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 3, } } }); var oncart = new Swiper('#oncart', { slidesPerView: 5, slidesPerColumn: 1, paginationClickable: true, slidesPerColumnFill: 'row', pagination: '.swiper-pagination-line1', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 1, } } }); var news = new Swiper('#new', { slidesPerView: 5, slidesPerColumn: 2, paginationClickable: true, slidesPerColumnFill: 'row', pagination: '.swiper-pagination-line2', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 2, } } }); var newp = new Swiper('#newp', { slidesPerView: 5, slidesPerColumn: 2, slidesPerColumnFill: 'column', paginationClickable: true, pagination: '.swiper-pagination-line3', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 3, } } }); var geyin = new Swiper('#geyin', { slidesPerView: 5, slidesPerColumn: 2, slidesPerColumnFill: 'column', paginationClickable: true, pagination: '.swiper-pagination-line4', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 3, } } }); var gejiqiaoyin = new Swiper('#jiqiao', { slidesPerView: 5, slidesPerColumn: 2, slidesPerColumnFill: 'column', paginationClickable: true, pagination: '.swiper-pagination-line5', breakpoints: { 750: { slidesPerView: 3, slidesPerColumn: 3, } } }); $(window).scroll(function () { if ($(this).scrollTop() > 1) { $(".header").addClass("fixed"); } else { $(".header").removeClass("fixed"); } }); $("ul.menu li a").click(function () { var ids = $(this).attr('data-id'); $("ul.menu li a").removeClass("on"); $(this).addClass("on"); $(".global_menu_contents_inner .contab").removeClass("on"); $(".global_menu_contents_inner ." + ids).addClass("on"); }); $('a._drawerOpen').click(function () { $('#viewport').toggleClass("open"); $('body').addClass("scrollFixed"); }) $('a.search_btn').click(function () { //$('#viewport').toggleClass("open"); //$('body').addClass("scrollFixed"); $("#gSearch_box").toggle(); $('body').addClass("searchOpen"); $('.centbox').toggleClass("on"); }) $('.js-globalnav_close').click(function () { $('#viewport').removeClass('open'); $('body').removeClass("scrollFixed"); }) $(".link_list .more").click(function () { $(".link_list ul").toggleClass("on"); $(this).toggleClass("on"); }) $(".js_toggleViewTrigger").click(function () { $(this).toggleClass("js_on"); $(this).next("ul").toggle(); }) $("#globalnav li i.feather").click(function () { $(this).toggleClass("js_on"); $(this).next("ul").toggle(); }) $("body").on("click","#index-comments .tab a",function(e){ e.preventDefault(); $("#index-comments .tab a").removeClass("on"); $(this).addClass("on"); var id=$(this).index(); $("#index-comments .cons").removeClass("_selected"); $("#index-comments #review_c"+id).addClass("_selected"); }); $(".tag_more a").click(function () { $(this).toggleClass("on"); $(".tag_content ul").toggleClass("on"); $(".taglist").toggleClass("on"); }) var swiper = new Swiper('#update', { slidesPerView: 5, autoplay: 1000, loop: true, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', paginationClickable: true, spaceBetween: 10, breakpointsInverse: true, breakpoints: { 750: { slidesPerView: 3, spaceBetween: 0 } } }); var mySwiper = new Swiper('#banner', { autoplay: 5000, pagination: '.swiper-pagination-white', paginationType: 'fraction', mode: "vertical", loop: true, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', autoplayDisableOnInteraction: false, }); $(".list-category .toggle-btn").click(function () { var slideblock = $(this).parent().next(); if (slideblock.css('display') == 'none') { slideblock.slideToggle("fast"); $(this).addClass("open"); } else if (slideblock.css('display') == 'block') { slideblock.slideToggle("fast"); $(this).removeClass("open"); } }); var wi = $(document.body).width(); if (wi < 750) { $("#review").html("
" + $("#index-comments").html() + '
'); $("#pops").html("

特集コンテンツ

" + $(".topic").html() + '
'); $("#mbems").html("
" + $("#show_ems").html() + '
'); $("#mbrand").html("

ブランド すべて見る

" + $("#topIndex").html() + '
'); $("#mbkey").html("

旬ワード商品

"+$(".menu_container_new .first").html()+"
"); } $(window).resize(function () { var wi = $(document.body).width(); if (wi < 750) { $("#review").html("
" + $("#index-comments").html() + '
'); $("#pops").html("

特集コンテンツ

" + $(".topic").html() + '
'); $("#mbems").html("
" + $("#show_ems").html() + '
'); $("#mbrand").html("

ブランド すべて見る

" + $("#topIndex").html() + '
'); $("#mbkey").html("

旬ワード商品

"+$(".menu_container_new .first").html()+"
"); }else{ $("#review").html(""); $("#pops").html(""); $("#mbems").html(""); $("#mbrand").html(""); $("#mbkey").html(""); } }); $.get("flow.php?step=carts", function (result) { $(".cartbadge").html(result + ' 円'); $(".catnums").html(result); }); $('a.go-top').click(function(){$("html,body").animate({scrollTop: 0}, 500);return false;}); function tabbox(obj){ $("#"+obj).find("dd").on('click',function(){ $(this).toggleClass("b-color").siblings().removeClass("b-color"); $("#"+obj).find("li").eq($(this).index()).toggleClass("b-show").siblings().removeClass("b-show"); }); } tabbox("tab-box"); $(".box__coupon-state").click(function(){ $(".coup").load( "/flow.php?step=coupons", function() {}); layer.open({ type: 1, title: false, shadeClose: true, close:true, shade: 0.8, area: ['86%', '76%'], content:$(".coup") }); }) var mySwiper = new Swiper('#goods_info', { autoplay: 5000, pagination: '.swiper-pagination-picture', paginationType: 'fraction', mode: "vertical", loop: true, nextButton: '.button-next-picture', prevButton: '.button-prev-picture', autoplayDisableOnInteraction: false, }); $('#otherInfo h3').click(function(){ $(this).find('i').toggleClass('open1'); $(this).next('section').toggle(); }) $('.reviewFlatTab li').click(function () { $('.reviewFlatTab li').removeClass('_selected'); $(this).addClass('_selected') $('._tabArea ._contents').removeClass('_selected'); var qq = $(this).index(); $('._tabArea ._contents').eq(qq).addClass('_selected') }) videoShow = function (){ $("#gallery-video-start").hide(); $("#gallery-video-close").show(); $("#video-container").show(); $("#pic-container").hide(); if(window.tcplayer && !window.tcplayer.playing()){ window.tcplayer.togglePlay(); } var idx = 0; $('#pro-gallerys li').each(function(id, obj) { if ($(obj).hasClass('current')) { idx = id; } }); } videoHide = function (){ $("#gallery-video-start").show(); $("#gallery-video-close").hide(); $("#video-container").hide(); $("#pic-container").show(); if(window.tcplayer && window.tcplayer.playing()){ window.tcplayer.togglePlay(); } } $("#pro-gallerys li").click(function(){ var _img=$(this).find("img").attr("src"); $("#pro-gallerys li").removeClass("current"); $(this).addClass("current"); $("#pic-container img").attr("src",_img); }) $(function(){ $('.retrie dt a').click(function(){ var $t=$(this); if($t.hasClass('up')){ $(".retrie dt a").removeClass('up'); $('.downlist').hide(); $('.mask').hide(); }else{ $(".retrie dt a").removeClass('up'); $('.downlist').hide(); $t.addClass('up'); $('.downlist').eq($(".retrie dt a").index($(this)[0])).show(); $('.mask').show(); } }); $(".area ul li a:contains('"+$('#area').text()+"')").addClass('selected'); $(".wage ul li a:contains('"+$('#wage').text()+"')").addClass('selected'); }); $(".switch_menu li").click(function(){ $(".switch_menu li").removeClass("current"); $(this).addClass("current"); var ix=$(this).index(); $(".type_content .section").css("display","none"); $(".type_content .section").eq(ix).show(); }); var num=$(".tabBlock-content .childTree li").length; if(num ==undefined || num<10){ $(".tabBlock-content .childTree").addClass("on"); };