/*!--------------------------------------------------------------------------* * * common.js * *--------------------------------------------------------------------------*/ ; (function($, win, doc) { $(function(){ //FUTAPPS有効化 window.MYAPP = new FUTAPPS({ focusInfo : { disabled:true }, winInfo : { } }); ;(function() { $('a.js-scroll[href^="#"]').futSmoothScroll(); $('img.ovImg').futHoverImg(); // $('img.ovImgFd').futHoverImg({ fade: true }); $('.hovCls').futHoverClass(); $('.shareFb').futShare({ type: 'facebook' }); $('.shareTw').futShare({ type: 'twitter' }); $('.shareLine').futShare({ type: 'line' }); $('.shareIn').futShare({ type: 'linkedin' }); $('a[href^="tel:"]').futPreventLink({type:'pc'}); //$('.pagetop').futScrollAddClass({position:1000,cls:'active'}); //$('.itemList li').futTile(3,{resize:true}); $('.js-imgToBg').futImgToBg(); //$('#GHeadFix').futFixedScroll(); //$('.tabSect').futTabCont({fade:true}); $('.js-acWrap').futAccordion(); // $('body').futPreloader({ // before :function(){}, // progress:function(){}, // after:function(){} // }); })(); //================================================== // browser check //================================================== ;(function() { if(MYAPP.browser.isIE){ $('body').addClass('is-IE'); } else if(MYAPP.browser.isTb){ $('body').addClass('is-tablet'); } if(MYAPP.browser.isTouch){ $('body').addClass('is-touch'); } })(); //================================================== // clone contents //================================================== ;(function() { $('[data-clone]').each(function(){ var targetSelecter = $(this).data('clone'); if(targetSelecter){ var $target = $(targetSelecter); $(this).eq(0).html($target.html()); } }); })(); //================================================== // include contents //================================================== ;(function() { $('[data-include]').each(function(){ var $wrap = $(this); var str = $wrap.data('include'); var arr = str?str.split(','):{}; var targetSrc = arr[0]?arr[0]:null; var rootpath = arr[1]?arr[1]:'../'; if(targetSrc){ $.ajax({ url:targetSrc, dataType :'html', success :function(data){ data = data.replace(/\[rootpath\]/g, rootpath); $wrap.append(data); } }); } }); })(); //================================================== // fullPhoto //================================================== ;(function() { var $Wrapper = $('#Wrapper'); $('.js-fullPhoto').each(function(index){ var $wrap = $(this); var type = $wrap.data('type'); $wrap.wrapInner('
'); var $inner = $wrap.find('.js-fullPhotoInner'); $(win).on('resize.fullPhoto'+index,function(){ if(MYAPP.winLayout!='sp'){ if(type=='left'){ $inner.css({'margin-left':-1-$wrap.offset().left+'px'}); } else if(type=='right' && MYAPP.winW>=$Wrapper.width()){ $inner.css({'margin-right':-1-MYAPP.winW+($wrap.offset().left + $wrap.outerWidth())+'px'}); } } else { $inner.removeAttr('style'); } }).trigger('resize.fullPhoto'+index); }); })(); //================================================== // comContSect img clone //================================================== ;(function() { var $comContSect = $('.comContSect'); var $thumb = $comContSect.find('.thumbBlock .thumb'); $thumb.each(function(){ var $clone = $(''); $clone.append($(this).find('img').clone()); $(this).append($clone); }); })(); //================================================== // scroll anime //================================================== ;(function() { /* anime Wrap */ var $animeWrap = $('.js-animeWrap'); $animeWrap.addClass('is-animeInit'); $(win).on('scroll.anime',function(){ $animeWrap.each(function(index){ if(MYAPP.winT>20 && MYAPP.winT + MYAPP.winH * (MYAPP.winLayout=='sp'? 5/6 : 5/6) > $(this).offset().top){ $(this).addClass('is-animeActive'); } }); }).trigger('scroll.anime'); })(); //================================================== // TopKv //================================================== ;(function() { var $TopKv = $('#TopKv'); var activeCls = 'is-loadActive'; var timeoutCls = 'is-loadTimeout'; $TopKv.futPreloader({ startDelay: 100, timeoutTime: 2000, after:function(){ $TopKv.addClass(activeCls); }, timeout: function() { $TopKv.addClass(timeoutCls); } }); })(); //================================================== // popUp //================================================== (function(){ var $Wrapper = $('.innovationContent'); //$Wrapper.append('
'); var $popOpen = $('.js-popOpen'); var $popClose = $('.js-popClose'); var $PopOverlay = $('#PopOverlay'); var $PopWrap = $('#PopWrap'); var $popMain = $PopWrap.find('.popMain'); var scTm; var scAdjust = 50; var $mvIframe = $(null); var $mvVideo = $(null); window.popOpen = function(e){ if($PopWrap.is(':animated')) return false; var $Anc = $(this); var $target = $('#'+$Anc.data('target')); $('html').addClass('is-pop-open'); $PopWrap.fadeOut(200,function(){ var $clone = $target.clone(true); $clone.removeAttr('id'); $popMain.html($clone); $mvIframe = $PopWrap.find('iframe'); if($mvIframe.length>0){ $PopWrap.addClass('has-movie'); } $mvVideo = $PopWrap.find('video'); $mvVideo.each(function(){ $(this).attr('autoplay','true'); }); $PopOverlay.add($PopWrap).fadeIn(); var popWrapH = $PopWrap.innerHeight(); var adJustT =(MYAPP.winH-popWrapH)/2 - 10; if(adJustT<0) {adJustT=0;} $PopWrap.css('top',MYAPP.winT+adJustT+'px'); $mvIframe.each(function(){ var src = $(this).attr('src'); if(src.indexOf('?') != -1){ var prefix = '&'; } else { var prefix = '?'; } $(this).attr('allow','accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture'); $(this).attr('src',src+prefix+'autoplay=1&enablejsapi=1'); }); }); return false; } function popClose(){ if($PopWrap.is(':animated')) return false; $('html').removeClass('is-pop-open'); $PopOverlay.add($PopWrap).fadeOut(function(){ $popMain.html(''); $PopWrap.removeAttr('class'); }); $Wrapper.removeAttr('style'); return false; } $popOpen.click(popOpen); $popClose.add($PopOverlay).click(popClose); })(); //================================================== // otherInterviewsSect //================================================== ;(function() { var $otherInterviewsSect = $('.otherInterviewsSect'); var $listBlock = $otherInterviewsSect.find('.listBlock'); var $itemList = $listBlock.find('.itemList'); var $items = $itemList.children('li'); var $selfItem = $items.filter(function(){ return location.pathname.indexOf($(this).find('a').eq(0).attr('href')) !== -1; }); for(var i = 0 ; i<10 ; i++){ $items.eq(Math.floor(Math.random()*$items.length)).prependTo($itemList); } $selfItem.appendTo($itemList); $items.each(function(){ if($(this).is(':visible')){ $(this).find('img[data-src]').each(function(){ $(this).attr('src',$(this).data('src')); }); } }); })(); }); })(jQuery, window, document);