'use strict' // Start of use strict // bootstrap Animated Layer function bootstrapAnimatedLayer() { function doAnimations(elems) { //Cache the animationend event in a variable var animEndEv = 'webkitAnimationEnd animationend' elems.each(function() { var $this = $(this), $animationType = $this.data('animation') $this.addClass($animationType).one(animEndEv, function() { $this.removeClass($animationType) }) }) } //Variables on page load var $myCarousel = $('#mainSlider'), $firstAnimatingElems = $myCarousel .find('.carousel-item:first') .find("[data-animation ^= 'animated']") //Initialize carousel $myCarousel.carousel({ interval: 2500, ride: 'carousel' }) var myInterval=false; $('.carousel-indicators li').mouseover(function() { var ctrl = $(this); var interval=0; myInterval = setTimeout(function(){ ctrl.trigger("click"); },interval); }); $('.carousel-indicators li').mouseout(function(){ clearTimeout(myInterval); myInterval = false; }); //Animate captions in first slide on page load doAnimations($firstAnimatingElems) //Other slides to be animated on carousel slide event $myCarousel.on('slide.bs.carousel', function(e) { var $animatingElems = $(e.relatedTarget).find( "[data-animation ^= 'animated']" ) doAnimations($animatingElems) }) } // owl-Carousel Activation function owlCarouselActivation() { if ($('.classroom-carousel').length) { $('.classroom-carousel').owlCarousel({ autoplay: true, autoplayTimeout: 5000, loop: true, margin: 15, dots: false, navText: '', responsiveClass: true, responsive: { 0: { items: 2 }, 768: { items: 3 } } }) } } function teamCarouselActivation() { if ($('.team-carousel').length) { var $team = $('.team-carousel') var $current = $('.team-current .row'); $team.owlCarousel({ autoplay: true, autoplayTimeout: 5000, autoplayHoverPause:true, loop: true, margin: 10, dots: false, items: 4, navText: '' }) $team.on('changed.owl.carousel', function(event) { //console.log(event) //$team_list.find(".current").html(owl_team.find(".active:eq(1) li").html()); var $c = $team.find('.active:eq(1)') var $items = $('.team-carousel .owl-item') $items.removeClass('current') //console.log($items.length) $c.addClass('current') $current.html($c.find('.ctx').html()) }); $('.team-carousel .owl-item').hover(function(){ //console.log('当前',$(this).find('.ctx').html()); var $items = $('.team-carousel .owl-item'); $items.removeClass('current') $(this).addClass('current'); $current.html($(this).find('.ctx').html()) return false; }); } } // counterUpInit function counterUpInit() { if ($('.counter').length) { $('.counter').counterUp({ delay: 20, time: 5000 }) } } // filterizr Activation function filterizrActivation() { if ($('.filtr-container').length) { var filterizd = $('.filtr-container').filterizr({ layout: 'packed' }) $('.filter-list li.filter').on('click', function() { $('.filter-list li.filter').removeClass('active') $(this).addClass('active') }) } } // wow function wowActivation() { if ($('.wow').length) { var wow = new WOW({ mobile: false }) wow.init() } } // backToTop function backToTop() { if ($('.back2Top').length) { $('.back2Top').on('click', function() { $('html, body').animate( { scrollTop: 0 }, 500 ) }) } } // backToTopVisible function backToTopVisible() { if ($('.back2Top').length) { if ($(window).scrollTop() > 300) { $('.back2Top').addClass('totop') } else { $('.back2Top').removeClass('totop') } } } // preLoader function preLoaderActivation() { if ($('body').length) { $('body').queryLoader2({ barColor: '#000', backgroundColor: '#fff', percentage: true, deepSearch: false, barHeight: 5, minimumTime: 1000, fadeOutTime: 800 }) } } // fixedNav function fixedNav() { if ($('.main-header').length) { if ($(window).scrollTop() > 60) { $('.main-header').addClass('fixed-nav') } else { $('.main-header').removeClass('fixed-nav') } } } // mainMenu function mainMenu() { if ($("a[rel='m_PageScroll2id']").length) { $("a[rel='m_PageScroll2id']").mPageScroll2id({ highlightClass: 'active' }) } } // hamburger function hamburger() { if ($('.hamburger').length) { var hamburger = $('.hamburger') hamburger.on('click', function() { $(this).toggleClass('is-active') $('.navbar-nav li a[rel="m_PageScroll2id"] ').on('click', function(e) { e.preventDefault() $('.navbar-collapse').removeClass('show') $('.hamburger').removeClass('is-active') }) }) } } function initMap() { var center = new qq.maps.LatLng(30.638834, 104.06703) var map = new qq.maps.Map(document.getElementById('lbs'), { center: center, // 地图的中心地理坐标。 zoom: 18 // 地图的中心地理坐标。 }) var marker = new qq.maps.Marker({ position: center, map: map }) var anchor = new qq.maps.Point(0, 39), size = new qq.maps.Size(42, 68), origin = new qq.maps.Point(0, 0), markerIcon = new qq.maps.MarkerImage( 'https://3gimg.qq.com/lightmap/api_v2/2/4/99/theme/default/imgs/marker.png', size, origin, anchor ) marker.setIcon(markerIcon) } // instance of fuction while Document ready event jQuery(document).on('ready', function() { ;(function($) { //preLoaderActivation(); // var $tabs = $('.nav-tabs > li') var $tabs_content = $('.tab-pane') $tabs.hover(function() { if ($(this).hasClass('active')) { return } else { $tabs.removeClass('active') $(this).addClass('active') var id = $(this) .find('a') .attr('data-href') $tabs_content.hide() $(id).show() } }) var h = window.location.hash if (h) { $tabs_content.hide() $(h).show() var a = $("[data-href='" + h + "']") if (a) { var l = a.parent('li') if (l) { $tabs.removeClass('active') l.addClass('active') var body = $('html, body') body.stop().animate( { scrollTop: l.offset().top - 140 }, 1000, 'swing', function() {} ) } } } $('.dot li').hover(function() { var num = $(this).index() $(this) .parents('.banner') .find('.pic li') .eq(num) .show() .siblings() .hide() $(this) .css('background', '#84c225') .siblings() .css('background', '#a1c94e') }) $('.dot li a').click(function() { return false }) $('#vitrine').vitrine({ title: '已开启区域', color: '#fff', loop: true }) var oMarquee = document.getElementById('mq') //滚动对象 var iLineHeight = 75 //单行高度,像素 var iLineCount = 4 //实际行数 var iScrollAmount = 2 //每次滚动高度,像素 var run = function() { oMarquee.scrollTop += iScrollAmount if (oMarquee.scrollTop == iLineCount * iLineHeight) oMarquee.scrollTop = 0 if (oMarquee.scrollTop % iLineHeight == 0) { window.setTimeout(run, 2500) } else { window.setTimeout(run, 10) } } if (oMarquee) { oMarquee.innerHTML += oMarquee.innerHTML window.setTimeout(run, 2500) } $('#mq').hover( function() { iScrollAmount = 0 }, function() { iScrollAmount = 2 } ) $('[data-toggle="tooltip"]').tooltip() backToTop() wowActivation() owlCarouselActivation() teamCarouselActivation() bootstrapAnimatedLayer() //counterUpInit(); hamburger() initMap() /* var $navi = $(".main-header"), scrollTop = 0; $(window).scroll(function () { var y = $(this).scrollTop(), speed = 0.05, pos = y * speed, maxPos = 110; if (y > scrollTop) { pos = maxPos; } else { pos = 0; } scrollTop = y; $navi.css({ "-webkit-transform": "translateY(-" + pos + "%)", "-moz-transform": "translateY(-" + pos + "%)", "-o-transform": "translateY(-" + pos + "%)", "transform": "translateY(-" + pos + "%)" }); }); */ })(jQuery) }) // instance of fuction while Window Load event jQuery(window).on('load', function() { ;(function($) { //mainMenu(); //filterizrActivation(); })(jQuery) }) // instance of fuction while Window Scroll event jQuery(window).on('scroll', function() { ;(function($) { fixedNav() backToTopVisible() })(jQuery) }) /*========================================================================== ======================== Custom script for Mojo end =================== ============================================================================*/