//首页渐出效果 ;(function () { 'use strict'; var ismobile = { android: function() { return navigator.useragent.match(/android/i); }, blackberry: function() { return navigator.useragent.match(/blackberry/i); }, ios: function() { return navigator.useragent.match(/iphone|ipad|ipod/i); }, opera: function() { return navigator.useragent.match(/opera mini/i); }, windows: function() { return navigator.useragent.match(/iemobile/i); }, any: function() { return (ismobile.android() || ismobile.blackberry() || ismobile.ios() || ismobile.opera() || ismobile.windows()); } }; var fullheight = function() { if ( !ismobile.any() ) { $('.js-fullheight').css('height', $(window).height()); $(window).resize(function(){ $('.js-fullheight').css('height', $(window).height()); }); } }; var slidermain = function() { $('#fh5co-hero .flexslider').flexslider({ animation: "fade", slideshowspeed: 5000, directionnav: true, start: function(){ settimeout(function(){ $('.slider-text').removeclass('animated fadeinup'); $('.flex-active-slide').find('.slider-text').addclass('animated fadeinup'); }, 500); }, before: function(){ settimeout(function(){ $('.slider-text').removeclass('animated fadeinup'); $('.flex-active-slide').find('.slider-text').addclass('animated fadeinup'); }, 500); } }); $('#fh5co-hero .flexslider .slides > li').css('height', $(window).height()); $(window).resize(function(){ $('#fh5co-hero .flexslider .slides > li').css('height', $(window).height()); }); }; var centerblock = function() { $('.fh5co-section-with-image .fh5co-box').css('margin-top', -($('.fh5co-section-with-image .fh5co-box').outerheight()/2)); $(window).resize(function(){ $('.fh5co-section-with-image .fh5co-box').css('margin-top', -($('.fh5co-section-with-image .fh5co-box').outerheight()/2)); }); }; var responseheight = function() { settimeout(function(){ $('.js-responsive > .v-align').css('height', $('.js-responsive > img').height()); }, 1); $(window).resize(function(){ settimeout(function(){ $('.js-responsive > .v-align').css('height', $('.js-responsive > img').height()); }, 1); }) }; var mobilemenuoutsideclick = function() { $(document).click(function (e) { var container = $("#fh5co-offcanvas, .js-fh5co-nav-toggle"); if (!container.is(e.target) && container.has(e.target).length === 0) { if ( $('body').hasclass('offcanvas-visible') ) { $('body').removeclass('offcanvas-visible'); $('.js-fh5co-nav-toggle').removeclass('active'); } } }); }; var offcanvasmenu = function() { $('body').prepend('
'); $('#fh5co-offcanvas').prepend('