MediaWiki:SupportPage.js: Difference between revisions

Content deleted Content added
set fragment identifier when clicking a ToC link - phab:T205107
highlight current section when page first loads, as well as after scrolling
Line 48:
// Highlight current section in toc
var lastSection;
$(window).scroll(function highlightCurrentSection() {
var fromTop = $(this).scrollTop(); // Get container scroll position
var currentSection = toc.filter(function(item) {
Line 59:
currentSection.link.addClass('-active');
}
});
highlightCurrentSection();
$(window).scroll( highlightCurrentSection );
/* -- end of table of contents code -- */