$(document).ready( function() { var derection = ""; var animeSpeed = 0; var itemWidth = 0; var scrollFlg = false; var loop = false; if("pc" == "sp"){ derection = "horizontal"; } if(derection == "horizontal"){ itemWidth = 151; } if(0 == 1){ scrollFlg = true; loop = true; } if(0 == 1){ derection = "horizontal"; itemWidth = 151; } $('.carouselInner_0_0').flexslider({ animation: "slide", direction:derection, animationLoop: loop, itemWidth:itemWidth, itemMargin: 20, slideshow: scrollFlg, slideshowSpeed:animeSpeed, controlNav:false, start:function(){ $('.carouselInner_0_0 .flex-viewport').css('overflow','visible'); } }); var winSize = $(window).width(); var carouselWidth = 0 * 151; if(carouselWidth > winSize){ $('.carouselInner_0_0 .flex-direction-nav').removeClass('vector_display'); $('.carouselInner_0_1 .flex-direction-nav').removeClass('vector_display'); }else{ $('.carouselInner_0_0 .flex-direction-nav').addClass('vector_display'); $('.carouselInner_0_1 .flex-direction-nav').addClass('vector_display'); } // 自動スクロール時にループがおかしくならないように修正 if(0 == 1 && derection == "vertical"){ $('.carouselInner_0_0 .carousel_li').not('.clone').each(function(i){ if(i == 0){ return true; } if(i == $('.carouselInner_0_0 .carousel_li').not('.clone').size() - 1){ return true; } $('.carouselInner_0_0 ul.slides').append($(this).clone().attr('aria-hidden','true').addClass('clone').removeClass('flex-active-slide')); }); } }); $(window).resize(function() { var carousel0 = $('.carousel_parent_0_0.horizontal').width(); var carousel1 = $('.carousel_parent_0_1.horizontal').width(); var carouselWidth = 0 * 151; if(carouselWidth > carousel0){ $('.carouselInner_0_0 .flex-direction-nav').removeClass('vector_display'); }else{ $('.carouselInner_0_0 .flex-direction-nav').addClass('vector_display'); } if(carouselWidth > carousel1){ $('.carouselInner_0_1 .flex-direction-nav').removeClass('vector_display'); }else{ $('.carouselInner_0_1 .flex-direction-nav').addClass('vector_display'); } }); $(window).load(function(){ // 一瞬縦に表示されてから横に表示される現象の回避 $('.related_item_list').css('visibility', 'visible'); });