MediaWiki:SupportPage.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary |
||
Line 45: | Line 45: | ||
toc[i].link.on( 'click', toc[i], smoothScroll ); |
toc[i].link.on( 'click', toc[i], smoothScroll ); |
||
} |
} |
||
// fix inbound fragment links |
|||
function delayedFragmentTargetOffset() { |
|||
var offset = $(':target').offset(); |
|||
if (offset) { |
|||
var scrollto = offset.top - scrollOffset; |
|||
$('html, body').animate({ scrollTop: scrollto }, 0); |
|||
} |
|||
} |
|||
setTimeout(delayedFragmentTargetOffset, 500); |
|||
// Highlight current section in toc |
// Highlight current section in toc |