window.onscroll = function(){ var t = document.documentElement.scrollTop || document.body.scrollTop; if( t >= 1 ) { $('#c_static_001-16420726227420').addClass("headerwx"); } else { $('#c_static_001-16420726227420').removeClass("headerwx"); } } var windName = window.location.pathname; var time = setInterval(function () { var m = $(".e_text-3 a").attr("href"); if (m) { console.log(m); $(".e_text-3 a").each(function () { var l_m = $(this).attr("href") if (l_m == windName) { $(this).parents('.e_text-3').addClass("active") } }); clearInterval(time); } }, 100);