mirror of
git://develop.git.wordpress.org/
synced 2025-01-29 18:48:18 +01:00
Twenty Seventeen: Resolves focused controls hidden by the top menu.
When a page is scrolled, the top nav menu become fixed. Depending on the page content this caused issue where focused links or buttons may be hidden behind the nav menu. Props afercia, davidakennedy, Fencer04 Fixes #38476 git-svn-id: https://develop.svn.wordpress.org/trunk@39225 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6d7ed1e861
commit
bffa48a6ee
@ -27,7 +27,7 @@
|
||||
resizeTimer;
|
||||
|
||||
// Ensure the sticky navigation doesn't cover current focused links.
|
||||
$( '#content a, #colophon a' ).focus( function() {
|
||||
$( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).focus( function() {
|
||||
if ( $navigation.hasClass( 'site-navigation-fixed' ) ) {
|
||||
var windowScrollTop = $( window ).scrollTop(),
|
||||
fixedNavHeight = $navigation.height(),
|
||||
@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
if ( offsetDiff < fixedNavHeight ) {
|
||||
$( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 600 );
|
||||
$( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 0 );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user