/* ---------------------------------------------------------------------------- スクロールで画面表示 ---------------------------------------------------------------------------- */ $(function(){ $('.p-recruitContent__item').bind('inview', function(event, isInView, visiblePartX, visiblePartY) { $(this).animate({opacity:1},1000); }); }); (function (factory) { if (typeof define == 'function' && define.amd) { define(['jquery'], factory); } else if (typeof exports === 'object') { module.exports = factory(require('jquery')); } else { factory(jQuery); } }(function ($) { var inviewObjects = [], viewportSize, viewportOffset, d = document, w = window, documentElement = d.documentElement, timer; $.event.special.inview = { add: function(data) { inviewObjects.push({ data: data, $element: $(this), element: this }); if (!timer && inviewObjects.length) { timer = setInterval(checkInView, 250); } }, remove: function(data) { for (var i=0; i viewportOffset.top && elementOffset.top < viewportOffset.top + viewportSize.height && elementOffset.left + elementSize.width > viewportOffset.left && elementOffset.left < viewportOffset.left + viewportSize.width) { if (!inView) { $element.data('inview', true).trigger('inview', [true]); } } else if (inView) { $element.data('inview', false).trigger('inview', [false]); } } } $(w).bind("scroll resize scrollstop", function() { viewportSize = viewportOffset = null; }); if (!documentElement.addEventListener && documentElement.attachEvent) { documentElement.attachEvent("onfocusin", function() { viewportOffset = null; }); } })); /* ---------------------------------------------------------------------------- スライドランダム ---------------------------------------------------------------------------- */ $(function(){ var randomContent = []; $('.js-slider-layout01 li').each(function() { randomContent.push($(this).html()); }); randomContent.sort(function() { return Math.random() - Math.random(); }); $('.js-slider-layout01 li').empty(); i = 0; $('.js-slider-layout01 li').each(function() { $(this).append(randomContent[i]); i++; }); }); var sliderLayout01 = (function(){ function init(){ $('.js-slider-layout01').slick({ lazyLoad: 'ondemand', infinite: true, slidesToShow: 4, slidesToScroll: 1, arrows: false, autoplay: true, autoplaySpeed: 3000, dots: true, responsive: [{ breakpoint: 768, settings: { centerMode: true, centerPadding: '60px', slidesToShow: 1, slidesToScroll: 1, } }] }); }; return { init: init } })(); $(function(){ sliderLayout01.init(); }); $(function(){ var randomContent = []; $('.js-slider-layout02 li').each(function() { randomContent.push($(this).html()); }); randomContent.sort(function() { return Math.random() - Math.random(); }); $('.js-slider-layout02 li').empty(); i = 0; $('.js-slider-layout02 li').each(function() { $(this).append(randomContent[i]); i++; }); }); var sliderLayout02 = (function(){ function init(){ $('.js-slider-layout02').slick({ lazyLoad: 'ondemand', infinite: true, slidesToShow: 3, slidesToScroll: 1, autoplay: true, autoplaySpeed: 3000, arrows: true, prevArrow: '', nextArrow: '', responsive: [{ breakpoint: 768, settings: { centerMode: true, centerPadding: '40px', slidesToShow: 1, slidesToScroll: 1, arrows:false, } }] }); }; return { init: init } })(); $(function(){ sliderLayout02.init(); }); /* ---------------------------------------------------------------------------- 高さ調整 ---------------------------------------------------------------------------- */ var utility = (function(){ function init(){ $('.p-recruitSlide__item .p-recruitSlideCaption').matchHeight(); }; return { init: init } })(); $(function(){ utility.init(); });