Twenty Seventeen: Fix smooth scrolling skip link

The link was scrolling too far. The main problem was that the `menuTop` variable lost it's initial definition of `0`, so all future subtractions were failing.

Props tywayne.

Fixes #38448.


git-svn-id: https://develop.svn.wordpress.org/trunk@38886 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
David A. Kennedy 2016-10-24 17:58:18 +00:00
parent 58075601c6
commit ad319b1b1f

View File

@ -23,7 +23,7 @@
idealNavHeight, idealNavHeight,
navIsNotTooTall, navIsNotTooTall,
headerOffset, headerOffset,
menuTop, menuTop = 0,
resizeTimer; resizeTimer;
/** /**
@ -149,7 +149,7 @@
* 'Scroll Down' arrow in menu area * 'Scroll Down' arrow in menu area
*/ */
if ( $( 'body' ).hasClass( 'admin-bar' ) ) { if ( $( 'body' ).hasClass( 'admin-bar' ) ) {
menuTop = -32; menuTop -= 32;
} }
if ( $( 'body' ).hasClass( 'blog' ) ) { if ( $( 'body' ).hasClass( 'blog' ) ) {
menuTop -= 30; // The div for latest posts has no space above content, add some to account for this menuTop -= 30; // The div for latest posts has no space above content, add some to account for this