$(document).ready(function(){ //导航展开收缩 if ($(window).width() > 768) { // $('.nav-btn').hover(function () { // $(".nav-bar").stop().slidedown(500, function () { // $(".nav-bar").css("height", "auto"); // }); // }, function (e) { // $(".nav-bar").stop().slideup(500, function () { // $(".nav-bar").css("height", "auto"); // }); // }); $('.nav .nli').hover(function () { $(this).find(".ul-sub").fadein(500) }, function (e) { $(this).find(".ul-sub").fadeout(200) }); } else{ var n=0; $('.nav-btn .zuo').click(function () { if(n==0){ $(this).parent(".nav-btn").addclass("cur"); $(".nav-bar").stop().slidedown(500, function () { }); n=1; } else{ $(this).parent(".nav-btn").removeclass("cur"); $(".nav-bar").stop().slideup(500, function () { }); n=0; } }) } //展开下级菜单 $('.menu-tab.par').on('click', function (event) { event.preventdefault(); $(this).parent('.nav-item').addclass("active").siblings().removeclass('active'); if ($(this).hasclass('show-sub')) { $(this).removeclass('show-sub'); $(this).next('.menu-sub').slideup(500); } else { $('.menu-tab').removeclass('show-sub') $(this).addclass('show-sub'); $('.menu-sub').slideup(500); $(this).next('.menu-sub').slidedown(500); } }); //鼠标经过事件 $('.menu-tab').hover(function () { $(this).parent('.nav-item').addclass("active").siblings().removeclass('active'); }, function () { if (!$(this).hasclass('show-sub')) { $('.nav-item').removeclass('active'); } }); //企业动态 $('.news-item').each(function (index, el) { $(this).find('a').hover(function () { $(this).children(".news-cover").fadein(500); $(this).children('.news-item-info').addclass("show"); }, function () { $(this).children(".news-cover").fadeout(500); $(this).children('.news-item-info').removeclass("show"); }); }); //品质内容显示 $('.service-item').hover(function () { $(this).find('.service-text').stop(true, true).fadein(); $(this).find('.ripple').hide(); }, function () { $(".ripple").show(); $('.service-text').stop(true, true).fadeout(); }); //二维码显示 $('.wechat').hover(function () { $('.wechat-code').fadein(200); }, function () { $('.wechat-code').fadeout(200); }); //底部导航 $('.menu-bot li').hover(function () { $(this).find('.menu-sub-con').fadein(200); }, function () { $(this).find('.menu-sub-con').fadeout(200); }); $(".uptop").click(function(){ $("html,body").animate({scrolltop: 0}, 500); }); function topshow(){ if ($(window).scrolltop() > 10) { $(".uptop").fadein(); } else { $(".uptop").fadeout(); } } if ($(window).width() > 1100) { topshow() $(window).scroll(function() { topshow() }); } //内页导航栏 var dabgx = $(".nybanner").outerheight(); function gundong(){ var scrolltop =$(window).scrolltop(); if($(window).width() > 1000) { if(scrolltop > dabgx && $('.nytop').length > 0){ $(".nytop").show(); $(".nav-btn").addclass("shou"); $(".logo").hide(); $(".nav-btn1").hide(); $(".topmenu").fadein(); } else{ $(".nytop").hide(); $(".nav-btn").removeclass("shou"); $(".logo").show(); $(".nav-btn1").show(); $(".topmenu").hide(); } } }; gundong() $(window).scroll(function(){ gundong() }) if($(window).width() < 1000) { $(".nylogo").click(function(){ $(".nytop").toggleclass("cur") }); } $(".topmenu>p").click(function(){ $(this).addclass("cur").siblings("p").removeclass("cur"); $("html,body").animate({scrolltop: $(".item").eq($(this).index()).offset().top - 60}, 500); }); $(".teshu>p").click(function(){ $(this).addclass("cur").siblings("p").removeclass("cur"); $("html,body").animate({scrolltop: $(".item").eq($(this).index()).offset().top - 60}, 500); }); })