MediaWiki:SupportPage.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
change scroll offset again, try to align with top of TOC
fix
Tag: Undo
Line 32: Line 32:


// Add smooth scrolling effect
// Add smooth scrolling effect
var scrollOffset = 70, // Offset in px
var scrollOffset = 88, // Offset in px
scrollDuration = 500, // in ms
scrollDuration = 500, // in ms
smoothScroll = function(event) {
smoothScroll = function(event) {
Line 51: Line 51:
var fromTop = $(this).scrollTop(); // Get container scroll position
var fromTop = $(this).scrollTop(); // Get container scroll position
var currentSection = toc.filter(function(item) {
var currentSection = toc.filter(function(item) {
return fromTop > item.anchor.offset().top - 88;
return fromTop > item.anchor.offset().top - 64;
});
});
currentSection = currentSection[currentSection.length - 1];
currentSection = currentSection[currentSection.length - 1];