Difference between revisions of "Template:BNU-CHINA/article"
Line 52: | Line 52: | ||
} | } | ||
− | var currentIdx = | + | var currentIdx = -1; |
$("article h2").each(function (index, item) { | $("article h2").each(function (index, item) { | ||
if($(window).scrollTop() > $(item).offset().top - baseline - $(".sub-header").height()) { | if($(window).scrollTop() > $(item).offset().top - baseline - $(".sub-header").height()) { | ||
Line 62: | Line 62: | ||
"color": "#278A75" | "color": "#278A75" | ||
}); | }); | ||
− | + | ||
− | $($("ul.sub-nav a")[currentIdx]).css({ | + | if (currentIdx >= 0) { |
− | + | $($("ul.sub-nav a")[currentIdx]).css({ | |
− | + | "color": "#D3853D" | |
+ | }); | ||
+ | } | ||
}); | }); | ||
}); | }); |
Revision as of 20:33, 17 September 2015