//app-header var accordion = function (el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.p_tig'); links.on('click', { el: this.el, multiple: this.multiple }, this.dropdown) } accordion.prototype.dropdown = function (e) { var $el = e.data.el; $this = $(this), $next = $this.parents('.p_parent').find(".p_slide"); $next.slidetoggle(); $this.parents('.p_parent').toggleclass('open'); if (!e.data.multiple) { $el.find('.p_slide').not($next).slideup().parent().removeclass('open'); }; } var accordion_header = new accordion($('.nav-list'), false); var navhear = $(".header-app"); $(".navbar-togger").on("click", function () { var open = navhear.hasclass("open-menu"); if (open) { navhear.removeclass("open-menu"); $(".navbar-togger").removeclass('on') $('.nav-menu').hide(); } else { navhear.addclass("open-menu"); $('.nav-menu').show(); } }); //foot-nav $(".p_parent>li .footer-tig").click(function () { $(this).closest("li").toggleclass("on").siblings("li").removeclass("on").find(".footer_nav2").slideup(500); $(this).siblings(".footer_nav2").slidetoggle(500); }); // 自定义 // aos (function ($) { jquery(window).on('load', function () { aos.init({ disable: 'mobile', duration: 1800, easing: 'ease-out-cubic', disable: 'mobile' }); }); })(jquery) // pc导航 $(function () { var top1 = 0; $(".header").removeclass("header2") $(window).scroll(function () { var top2 = $(window).scrolltop(); if (top2 > top1) { $(".header").addclass("header2") } else { $(".header").removeclass("header2") } if (top2 == 0) { $(".header").removeclass("header2") } top1 = top2; }) }) // 鼠标跟随 dotmove(); function dotmove(e) { var obj = $("#c-followdot"); var aa = $("a"); var bw = $("body").width() - 25; $(document).mousemove(function (e) { var endx = e.clientx; var endy = e.clienty; if (endx > bw) { endx = bw; } obj.css({ "left": endx + "px", "top": endy + "px" }); }); aa.hover(function () { obj.addclass("c-active"); }, function () { obj.removeclass("c-active"); }); } // 锚点 $('.nei_anchor').onepagenav(); //数字跳动 $('.sztd').countup({ delay: 50, time: 3000 }); // 视频弹窗1 $('.abo_video').click(function () { var src src = $(this).attr('data-src') $('#msg-box-bg').stop(true, false).fadein() $('#msg-box-bg .msg-box').stop(true, false).animate({ 'top': '50%', }, 800) $('#msg-box-bg').find('iframe').attr('src', src) // $('body').css({'overflow':'hidden'});//弹框后禁止浏览器滚动 }) $('#close-box').click(function () { $('#msg-box-bg').stop(true, false).fadeout() $('#msg-box-bg .msg-box').stop(true, false).animate({ 'top': '-50%', }, 300) $('#msg-box-bg').find('iframe').attr('src', '') // $('body').css({'overflow':'auto'}); });