MediaWiki:SupportPage.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
rm topmenuheight, not needed here |
||
Line 19: | Line 19: | ||
var lastId, |
var lastId, |
||
topMenu = $("#toc > ul"), |
topMenu = $("#toc > ul"), |
||
topMenuHeight = topMenu.outerHeight()+1, |
|||
// All list items |
// All list items |
||
menuItems = topMenu.find("a"), |
menuItems = topMenu.find("a"), |
||
Line 29: | Line 28: | ||
menuItems.click(function(e){ |
menuItems.click(function(e){ |
||
var href = $(this).attr("href"), |
var href = $(this).attr("href"), |
||
offsetTop = href === "#" ? 0 : $(href).offset().top |
offsetTop = href === "#" ? 0 : $(href).offset().top; |
||
$('html, body').stop().animate({ |
$('html, body').stop().animate({ |
||
scrollTop: offsetTop |
scrollTop: offsetTop |
||
Line 39: | Line 38: | ||
$(window).scroll(function(){ |
$(window).scroll(function(){ |
||
// Get container scroll position |
// Get container scroll position |
||
var fromTop = $(this).scrollTop() |
var fromTop = $(this).scrollTop(); |
||
// Get id of current scroll item |
// Get id of current scroll item |