//导航高亮 var pathName = window.location.pathname; // 获得路径信息 $(".f-cb a").each(function() { // 遍历a链接的路径 var aLinkUrl = $(this).attr("href"); // 得到a链接的路径 if (aLinkUrl == pathName) { $(this).parent(".hvr-left").addClass("jpActive"); return; } }); //分类高亮 var pathName = window.location.pathname; // 获得路径信息 $(".content .yjLink").each(function() { // 遍历a链接的路径 var aLinkUrl = $(this).attr("href"); // 得到a链接的路径 if (aLinkUrl == pathName) { $(this).parent().addClass("jpActive"); return; } }); //分类链接添加前缀地址 var wHref = window.location.pathname; $(".publicProCate").each(function() { var aHref = $(this).attr("href"); var aHttp = aHref.indexOf("http://"); var subHref; switch (aHttp) { case 0: subHref = aHref.substr(7); break; default: subHref = aHref.substr(8); } $(this).attr("href", subHref); }); //初始化wow开始 if(isFrontEnv()){ new WOW().init(); } //初始化wow结束 //置顶 (function() { $('a[href-data="top"]').on('click', function() { $('html, body').animate({ scrollTop: 0 }, 'slow'); return false; }); })(); //导航超过一定高度,添加类名 $(function() { //超过一定高度导航添加类名 var nav = $(".navBox"); //得到导航对象 var win = $(window); //得到窗口对象 var sc = $(document); //得到document文档对象。 win.scroll(function() { if (sc.scrollTop() >= 160) { nav.addClass("on"); } else { nav.removeClass("on"); } }); }); //擦除动效添加类名 $(document).ready(function(){ //关于我们文字 $('#w_grid-1602733517862').attr('data-delighter',''); $('#w_grid-1602733517862').addClass('h_LeftShow'); //关于我们图片 $('#w_fimg-1602316596814').attr('data-delighter',''); $('#w_fimg-1602316596814').addClass('h_UpShow'); }); //锚点缓动效果 $(function() { var log = window.location.hash; var stop = $(log).offset().top - 150; console.log(stop); $(function() { $("html,body").stop().animate({ "scrollTop": stop }, 1000); }); }); $('a[href*="#"]:not([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) { $('html, body').animate({ scrollTop: target.offset().top -150 }, 1000); return false; } } });