//导航高亮 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; } } });