$(function(){ $('#mainimg ul').slick({ dots: true, infinite: true, slidesToShow: 1, arrows: false, centerMode: true, variableWidth: true, autoplay: true, autoplaySpeed: 5000, speed: 700, pauseOnFocus:false, pauseOnHover:false, pauseOnDotsHover:false, responsive: [{ breakpoint: 769, settings: { variableWidth: false, centerMode: false, }, }] }) .on("afterChange", function(event, slick, currentSlide, nextSlide) { switch (currentSlide){ case 0: // 1枚目のスライド $(this).slick("slickSetOption", "autoplaySpeed", 5000); break; default: // その他のスライド $(this).slick("slickSetOption", "autoplaySpeed", 3000); break; } }); $("#mainimg > span.arrow-r").on('click',function(){ $('#mainimg ul').slick('slickNext'); }); $("#mainimg > span.arrow-l").on('click',function(){ $('#mainimg ul').slick('slickPrev'); }); $('#newmenu div.contents ul').slick({ infinite: true, slidesToShow: 1, arrows: false, variableWidth: true, speed: 700, pauseOnFocus:false, pauseOnHover:false, pauseOnDotsHover:false, }); $("#newmenu div.contents span.arrow-r").on('click',function(){ $('#newmenu div.contents ul').slick('slickNext'); }); $("#newmenu div.contents span.arrow-l").on('click',function(){ $('#newmenu div.contents ul').slick('slickPrev'); }); $('#column div.contents ul').slick({ infinite: true, slidesToShow: 1, arrows: false, variableWidth: true, speed: 700, pauseOnFocus:false, pauseOnHover:false, pauseOnDotsHover:false, }); $("#column div.contents span.arrow-r").on('click',function(){ $('#column div.contents ul').slick('slickNext'); }); $("#column div.contents span.arrow-l").on('click',function(){ $('#column div.contents ul').slick('slickPrev'); }); //imgchg(); }); $(window).load(function(){ //imgchg(); }); $(window).resize(function () { //imgchg(); }); $(window).on('orientationchange', function(){ //imgchg(); }); function settop(){ var seth = $("#contents > ul > li:nth-child(1)").outerHeight(); var seth2 = seth - 20 - $("#contents > ul > li:nth-child(6) h2").outerHeight() - 10; $("#contents > ul > li:nth-child(6)").css("height",seth + "px"); $("#contents > ul > li:nth-child(6) div.img").css("height",seth2 + "px"); } /* function imgchg(){ var $el_480 = $('.imgchg_480'); var $el_768 = $('.imgchg_768'); var sp = '_sp.'; var pc = '_pc.'; var state = $("#header").css("background-size"); //768以下 $el_768.each(function() { var $this = $(this); if(state == 'cover'){ $this.attr('src', $this.attr('src').replace(pc, sp)); } else { $this.attr('src', $this.attr('src').replace(sp, pc)); } }); //480以下 $el_480.each(function() { var $this = $(this); if(state == 'contain'){ $this.attr('src', $this.attr('src').replace(pc, sp)); } else { $this.attr('src', $this.attr('src').replace(sp, pc)); } }); } */