Zhuangpeiyue (Talk | contribs) |
Zhuangpeiyue (Talk | contribs) |
||
Line 5: | Line 5: | ||
$(function(){ | $(function(){ | ||
var url=window.location.pathname.split('/'); | var url=window.location.pathname.split('/'); | ||
− | $('#header .header_nav>[data-name='+ | + | var currentPage=url[2]; |
+ | if(!currentPage) | ||
+ | currentPage='Home'; | ||
+ | else if(currentPage=='Attributions') | ||
+ | currentPage='Attributions'; | ||
+ | $('#header .header_nav>[data-name='+currentPage+']').addClass('active').siblings().removeClass('active'); | ||
$(window).on('scroll',function(){ | $(window).on('scroll',function(){ | ||
var top=$(this).scrollTop(); | var top=$(this).scrollTop(); |
Revision as of 06:55, 24 October 2017