/*! * * Angle - Bootstrap Admin App * * Version: 3.4 * Author: @themicon_co * Website: http://themicon.co * License: https://wrapbootstrap.com/help/licenses * */ function IEVersion() { var userAgent = navigator.userAgent; //鍙栧緱娴忚鍣ㄧ殑userAgent瀛楃涓 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //鍒ゆ柇鏄惁IE<11娴忚鍣 var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //鍒ゆ柇鏄惁IE鐨凟dge娴忚鍣 var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; if (isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if (fIEVersion == 7) { return 7; } else if (fIEVersion == 8) { return 8; } else if (fIEVersion == 9) { return 9; } else if (fIEVersion == 10) { return 10; } else { return 6;//IE鐗堟湰<=7 } } else if (isEdge) { return 'edge';//edge } else if (isIE11) { return 11; //IE11 } else { return -1;//涓嶆槸ie娴忚鍣 } } (function ($) { 'use strict'; if (typeof $ === 'undefined') { throw new Error('This site\'s JavaScript requires jQuery'); } // cache common elements var $win = $(window); var $doc = $(document); var $body = $('body'); // Site Preloader // ----------------------------------- // NProgress.start(); $('#header') .waitForImages(function () { // NProgress.done(); $body.addClass('site-loaded'); }); // Init Writing Mode // ----------------------------------- // Global RTL Flag window.modeRTL = false; // get mode from local storage // modeRTL = !!$.localStorage.get('modeRTL'); // console.log('Site is in '+(modeRTL?'RTL':'LTR')+' mode.'); // Show sticky topbar on scroll // ----------------------------------- var stickyNavScroll; var stickySelector = '.navbar-sticky.navbar-sticky-enabled'; // Setup functions based on screen if (matchMedia('(min-width: 992px), (max-width: 767px)').matches) { stickyNavScroll = function () { var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop; if (top > 40) $(stickySelector) .stop() .animate({'top': '0'}); else $(stickySelector) .stop() .animate({'top': '-80'}); }; } if (matchMedia('(min-width: 768px) and (max-width: 991px)').matches) { stickyNavScroll = function () { var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop; if (top > 40) $(stickySelector) .stop() .animate({'top': '0'}); else $(stickySelector) .stop() .animate({'top': '-120'}); }; } // Finally attach to events $doc.ready(stickyNavScroll); $win.scroll(stickyNavScroll); // Sticky Navigation // ----------------------------------- $(function () { $('.main-navbar') .onePageNav({ scrollThreshold: 0.25, filter : ':not(.external)', // external links changeHash : true, scrollSpeed : 750 }); }); // Video Background // ----------------------------------- $(function () { if (IEVersion() > 8 || IEVersion() === -1 && enableBackgroundVideo) { if (!$.browser.mobile) { var videoContainer = $('
') .prependTo($body); var videobackground = new $.backgroundVideo( // create a container videoContainer, { 'align' : 'centerXY', 'width' : 1280, 'height' : 720, 'path' : '/video/', 'filename': 'video', 'types' : ['webm', 'mp4'] }).$videoEl.on('loadeddata', function () { $('#header') .removeClass('novideo'); }); } } }); // Smooth Scroll // ----------------------------------- var scrollAnimationTime = 1200, scrollAnimationFunc = 'easeInOutExpo', $root = $('html, body'); $(function () { $('.scrollto') .on('click.smoothscroll', function (event) { var target = $(this).data('hash'); if(target && $('#'+target) && $('#'+target).offset()){ event.preventDefault(); $root.stop() .animate({ 'scrollTop': $('#'+target) .offset().top }, scrollAnimationTime, scrollAnimationFunc, function () { window.location.hash = target; }); } }); }); $(function () { // 绉诲姩绔彍鍗曟寜閽偣鍑 var wulunNavMobileBtn = $("#wulun-nav-mobile-btn"); var wulunNavMobileBtnIcon = $("#wulun-nav-mobile-btn-icon"); var wulunNavMobileContainer = $('#wulun-nav-mobile-container'); wulunNavMobileBtn.on('click', '', null, function () { if (wulunNavMobileContainer[0].classList.contains('active')) { // document.body.addClass('active'); document.body.style.overflowY='auto' wulunNavMobileContainer.removeClass('active'); wulunNavMobileBtnIcon.removeClass('fa-minus') .addClass('fa-bars'); } else { // document.body.removeClass('active'); document.body.style.overflowY='hidden' wulunNavMobileContainer.addClass('active'); wulunNavMobileBtnIcon.removeClass('fa-bars') .addClass('fa-minus'); } }); }); // Self close navbar on mobile click // ----------------------------------- $(function () { var navMain = $("#navbar-main"); var navToggle = $('.navbar-toggle'); navMain.on('click', 'a', null, function () { if (navToggle.is(':visible')) navMain.collapse('hide'); }); }); // Wow Animation // ----------------------------------- // setup global config if (IEVersion() > 8 || IEVersion() === -1) { window.wow = ( new WOW({ mobile: false }) ).init(); } // Owl Crousel // ----------------------------------- $(function () { if (IEVersion() > 8 || IEVersion() === -1) { $('#product-carousel') .owlCarousel({ rtl : window.modeRTL, responsiveClass: true, // responsive : { // 0: { // items: 3, // nav : false // } // }, autoplay : 1, loop : 1, rewind : 1, autoplayTimeout: 5e3, }); $('#feedback-carousel') .owlCarousel({ rtl : window.modeRTL, responsiveClass: true, responsive : { 0: { items: 1, nav : false } }, autoplay : 1, loop : 1, rewind : 1, autoplayTimeout: 2e3, }); $('#header-carousel') .owlCarousel({ rtl : window.modeRTL, responsiveClass: true, responsive : { 0: { items: 1, nav : false } }, autoplay : 1, loop : 1, rewind : 1, autoplayTimeout: 5e3, merge : true, }); $('#appshots') .owlCarousel({ rtl : window.modeRTL, autoplay : 1, loop : 1, autoplayTimeout: 2e3, rewind : 1, margin : 10, responsiveClass: true, responsive : { 0 : { items: 1, nav : false }, 500 : { items: 2, nav : false }, 1000: { items: 4, nav : false, loop : false } } }); // 涓诲浘 $('#wulun-main-carousel') .owlCarousel({ rtl : window.modeRTL, responsiveClass: true, responsive : { 0: { items: 1, nav : false } }, autoplay : 1, loop : 1, rewind : 1, autoplayTimeout: 5e3, }); // 鍥㈤槦椋庨噰 $('#team-life') .owlCarousel({ rtl : window.modeRTL, responsiveClass: true, responsive : { 0: { items: 1, nav : false } }, autoplay : 1, loop : 1, rewind : 1, autoplayTimeout: 5e3, }); } }); // Nivo Lightbox // ----------------------------------- $(function () { $('#appshots a') .nivoLightbox({ effect : 'fadeScale', // The effect to use when showing the lightbox theme : 'default', // The lightbox theme to use keyboardNav: true // Enable/Disable keyboard navigation (left/right/escape) }); }); })(window.jQuery); // Settings Handler // ----------------------------------- (function ($) { 'use strict'; // SHOW HIDE SETTINGS var settings = $('.settings'); $('.settings-ctrl') .on('click', function () { settings.toggleClass('show'); }); // Load THEME CSS var $loaders = $('[data-load-css]'); $loaders.on('click', function (e) { var element = $(this); $loaders.removeClass('checked'); element.addClass('checked'); if (element.is('a')) e.preventDefault(); var uri = element.data('loadCss'), link; if (uri) { link = createLink(uri); if (!link) { $.error('Error creating stylesheet link element.'); } } else { $.error('No stylesheet location defined.'); } }); function createLink(uri) { var linkId = 'autoloaded-stylesheet', oldLink = $('#' + linkId) .attr('id', linkId + '-old'); $('head') .append($('') .attr({ 'id' : linkId, 'rel' : 'stylesheet', 'href': uri })); if (oldLink.length) { oldLink.remove(); } return $('#' + linkId); } // SET WRITING MODE var stylesCss = $('#stylescss'), rtlSwitch = $('#rtlswitch'); $(function () { var uri = modeRTL ? '/css/styles-rtl.css' : '/css/styles.css'; stylesCss.attr('href', uri); // rtlSwitch[0].checked = modeRTL; }); rtlSwitch.on('change', function () { var isRTL = this.checked; $.localStorage.set('modeRTL', isRTL); // reload is required to initialize plugins in RTL mode window.location.reload(); }); })(window.jQuery); // END Settings Handler // ----------------------------------- // var animateButton = function(e) { // // e.preventDefault; // //reset animation // e.target.classList.remove('animate'); // // e.target.classList.add('animate'); // setTimeout(function(){ // e.target.classList.remove('animate'); // },700); // }; // // var classname = document.getElementsByClassName("bubbly-button"); // // for (var i = 0; i < classname.length; i++) { // classname[i].addEventListener('click', animateButton, false); // } var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?049eba31414c7c36bf3da5225bc75533"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();