MediaWiki:SupportPage.js: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
rm topmenuheight, not needed here
use document.getElementById to cope with odd characters
Line 27: Line 27:
// so we can get a fancy scroll animation
// so we can get a fancy scroll animation
menuItems.click(function(e){
menuItems.click(function(e){
var href = $(this).attr("href"),
var id = $(this).attr("href").replace('#', ''),
offsetTop = href === "#" ? 0 : $(href).offset().top;
offsetTop = $( document.getElementById(id) ).offset().top;
$('html, body').stop().animate({
$('html, body').stop().animate({
scrollTop: offsetTop
scrollTop: offsetTop