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("