// coolgee web js v2.1 $(document).ready(function(){ $(".menu-btn").click(function(){ $('.menu-con').toggleclass('open'); $('.about .nav').removeclass('open'); $('.product .nav').removeclass('open'); $('.news .nav').removeclass('open'); $('.solution .nav').removeclass('open'); $('.service .nav').removeclass('open'); $('.join .nav').removeclass('open'); }); $(".about").click(function(){ $('.about .nav').addclass('open'); $('.product .nav').removeclass('open'); $('.news .nav').removeclass('open'); $('.solution .nav').removeclass('open'); $('.service .nav').removeclass('open'); $('.join .nav').removeclass('open'); }); $(".product").click(function(){ $('.about .nav').removeclass('open'); $('.product .nav').addclass('open'); $('.news .nav').removeclass('open'); $('.solution .nav').removeclass('open'); $('.service .nav').removeclass('open'); $('.join .nav').removeclass('open'); }); $(".news").click(function(){ $('.about .nav').removeclass('open'); $('.product .nav').removeclass('open'); $('.news .nav').addclass('open'); $('.solution .nav').removeclass('open'); $('.service .nav').removeclass('open'); $('.join .nav').removeclass('open'); }); $(".solution").click(function(){ $('.about .nav').removeclass('open'); $('.product .nav').removeclass('open'); $('.news .nav').removeclass('open'); $('.solution .nav').addclass('open'); $('.service .nav').removeclass('open'); $('.join .nav').removeclass('open'); }); $(".service").click(function(){ $('.about .nav').removeclass('open'); $('.product .nav').removeclass('open'); $('.news .nav').removeclass('open'); $('.solution .nav').removeclass('open'); $('.service .nav').addclass('open'); $('.join .nav').removeclass('open'); }); $(".join").click(function(){ $('.about .nav').removeclass('open'); $('.product .nav').removeclass('open'); $('.news .nav').removeclass('open'); $('.solution .nav').removeclass('open'); $('.service .nav').removeclass('open'); $('.join .nav').addclass('open'); }); // // 二维码 // $("#window_btn_qr, #close_qr").click(function(){ // $("#window_qr").fadetoggle("fast"); // }); // 平滑滚动 $('a[href*=#]').click(function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']'); if ($target.length) { var targetoffset = $target.offset().top; $('html,body').animate({ scrolltop: targetoffset }, 800); return false; } } }); }); // 窗口滚动效果控制 $(function(){ var winheight = $(document).scrolltop(); $(window).scroll(function() { var scrolly = $(document).scrolltop(); if (scrolly > 200){ $('#header').addclass('suspend'); } else { $('#header').removeclass('suspend'); } }); });