$(function(){ (function(doc, win) { var docel = doc.documentelement, resizeevt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function() { var clientwidth = docel.clientwidth; if (!clientwidth) return; if (clientwidth <= 1024) { docel.style.fontsize = '100px'; } else { docel.style.fontsize = 100 * (clientwidth / 1920) + 'px'; } }; if (!doc.addeventlistener) return; win.addeventlistener(resizeevt, recalc, false); doc.addeventlistener('domcontentloaded', recalc, false); })(document, window); // 入场动画 $(function () { var w = $(window).width(); if (w > 1200) { if (!(/msie [6|7|8|9]/i.test(navigator.useragent))) { new wow( { callback: function (box) { $(box).addclass("wow1"); } }).init(); } $(window).resize(function () { new wow( { callback: function (box) { $(box).addclass("wow1"); } }).init(); }); } }) $(window).scroll(function(){ if(window.scrolly > 100){ $('.footer .return').addclass('act') }else{ $('.footer .return').removeclass('act') } }) // 返回顶部 $('.footer .return').click(function () { $('html,body').animate({ scrolltop: 0 + "px" }, 500); }) $("footer .f_top .f_right .bottom .icons .icon").hover(function(){ var index = $(this).index() $(this).addclass("on").siblings().removeclass("on") $("footer .f_top .f_right .bottom .code_box img").eq(index).addclass("on").siblings().removeclass("on") },function(){ }) $(".header .nav>li").hover(function(){ $(this).find(".h_nav2").stop().slidedown() // $(".header").addclass("hover") },function(){ $(this).find(".h_nav2").stop().slideup() // $(".header").removeclass("hover") }) // $("html,body").animate({ // scrolltop: 0, // screenleft: 0, // }, 400); /*锚点跳转*/ $(function () { //锚点跳转滑动效果 $('a.ph').click(function () { $('a.ph').removeclass("on") $(this).addclass("on") if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var $target = $(this.hash); // console.log($target.offset().top) $target = $target.length && $target || $('[id=' + this.hash.slice(1) + ']'); if ($target.length) { var targetoffset = $target.offset().top; $('html,body').animate({ scrolltop: targetoffset + 0+"px" }, 500); return false; } } }); }); var a=$(window).height(); $(window).scroll(function(){ var b=$(this).scrolltop(); $(".dh").each(function(){ var c=$(this).offset().top; if(a+b>c){ $(this).addclass("show") } else{ $(this).removeclass("show"); } }); }); var p=0;t=0; var htt; var hb = $(".ny_banner").height() $(window).scroll(function(e){ p=$(this).scrolltop(); // console.log(p) var w = $(window).width(); if(t<=p && p > 10){ // console.log('下滚') $(".header").addclass("on1") $(".header").addclass("hide") // $(".m_header").addclass("on") } else if(t>p){ // console.log('上滚') $(".header").removeclass("hide") // $(".m_header").removeclass("on") } if(t>p && p==0){ $(".header").removeclass("on1") } if(p-hb>0){ $(".pl_con .ml").addclass("show") } else if(p-hb<0){ $(".pl_con .ml").removeclass("show") } t = p; }) $(window).scroll(function(e){ p=$(this).scrolltop(); var h = $("body").height() var h1 = $(window).height() // console.log(h-p) var hp = h-p if(p>200){ $(".right_box").addclass("on") }else{ $(".right_box").removeclass("on") } if(hp==h1){ $(".right_box").removeclass("on") }if(p>500){ $(".i_part6").removeclass("hide") }else{ $(".i_part6").addclass("hide") } }) // pc头部 $("header .center>li").hover(function(){ // console.log("456465") $(this).find("ul").stop().slidedown() },function(){ $(this).find("ul").stop().slideup() }) $(".header .w1680 .right .lag").hover(function(){ // console.log("456465") $(this).find("ul").stop().slidedown() },function(){ $(this).find("ul").stop().slideup() }) $(".footer .link").hover(function(){ // console.log("456465") $(this).find("ul").stop().slidedown() },function(){ $(this).find("ul").stop().slideup() }) /*手机头部*/ $(".mh_nav .close").click(function(){ $(".mh_nav").removeclass("show") }) $(".m_header .btn").click(function(){ if($(this).hasclass("on")){ $(this).removeclass("on") $(".mh_nav").addclass("show") }else{ $(this).addclass("on") $(".mh_nav").addclass("show") } }) $(".mh_nav .nav>li").click(function(){ if($(this).hasclass("on")){ $(this).removeclass("on") $(this).find(".nav1").stop().slideup() }else{ $(this).addclass("on") $(this).find(".nav1").stop().slidedown() } }) // 移动端头部导航 $(window).scroll(function() { if ($(window).scrolltop() > 0) { $(".m_header").stop(true, false).addclass('act'); } else { $(".m_header").stop(true, false).removeclass('act'); } }); // 移动端导航展开 $('.m_header .headr .list').click(function(){ $(".m_header ").stop(true, false).addclass('act'); $('.m_header .m_menu').addclass('on') $('.m_header .top').addclass('on') }) $('.m_header .headr .list2').click(function(){ $(".m_header ").stop(true, false).addclass('act'); $('.m_header .m_menu').addclass('on') $('.m_header .top').addclass('on') }) $('.m_header .headr .cha').click(function(){ if ($(window).scrolltop() > 0) { $(".m_header").stop(true, false).addclass('act'); } else { $(".m_header").stop(true, false).removeclass('act'); } $('.m_header .m_menu').removeclass('on') $('.m_header .top').removeclass('on') if ($(window).scrolltop() > 0) { $(".m_header ").stop(true, false).addclass('act'); $(".m_header .top").stop(true, false).addclass('act'); } else if ($(window).scrolltop() <= 0) { $(".m_header .top").stop(true, false).removeclass('act'); } }) $(".m_header .m_menu .first").on('click', function() { if ($(this).siblings('.sec_list').is(':hidden')) { $(this).addclass('on'); $(this).siblings('.sec_list').stop().slidedown(); $(this).parent().siblings('li').children('.sec_list').stop().slideup().siblings('.tit').removeclass( 'on'); } else { $(this).removeclass('on'); $(this).siblings('.sec_list').stop().slideup(); } }); $(".m_header .m_menu .sec_item").on('click', function() { if ($(this).find('.third_list').is(':hidden')) { $(this).addclass('on'); $(this).siblings().removeclass('on'); $(this).find('.third_list').stop().slidedown(); $(this).siblings().children('.third_list').stop().slideup() } else { $(this).removeclass('on'); $(this).siblings().removeclass('on'); $(this).find('.third_list').stop().slideup(); } }); // 移动端底部导航 $(".m_footer .first i").on('click', function() { if ($(this).parent().siblings('.sec_list').is(':hidden')) { console.log('on') $(this).addclass('on'); $('.m_footer .sec_list').stop().slideup() $(this).parent().siblings('.sec_list').stop().slidedown(); } else { console.log('ion') $(this).removeclass('on'); $(this).parent().removeclass('on'); $(this).parent().siblings('.sec_list').stop().slideup(); } }); function mlangchange(){ // var index = $(this).index() // var file = $(this).attr('data-url') // console.log(file) // let a = document.createelement("a"); // a.setattribute("href", file) // a.setattribute("download", file) // a.setattribute("target", "_blank") // let clickevent = document.createevent("mouseevents") // clickevent.initevent("click", true, true) // a.dispatchevent(clickevent) } // 回到顶部 $(".back").click(function () { $('body,html').animate({ scrolltop: 0 }, 500); return false; }); })