[wp-trac] [WordPress Trac] #42276: Twenty Seventeen: Bug with global.js (links not working)

WordPress Trac noreply at wordpress.org
Sat Aug 21 21:58:04 UTC 2021

#42276: Twenty Seventeen: Bug with global.js (links not working)
 Reporter:  celinegrosjean  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Bundled Theme   |     Version:  4.9
 Severity:  normal          |  Resolution:  invalid
 Keywords:                  |     Focuses:  javascript
Changes (by sabernhardt):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


 Thanks for the report!

 I see that you removed the
 content/themes/twentyseventeen/assets/js/global.js#L28 scrolling function]
 after discovering it did not work properly with your site. The function
 was added in ticket:38476, to prevent the fixed top menu from hiding
 focused controls. Of course, you did not want the navigation fixed at the

 This seems related to `.navigation-top {height: 100%;}` in your child
 theme stylesheet. With that, the `fixedNavHeight` value is greater than
 the offset, so the script would run the `scrollTo` function when clicking
 on a link.

 Adding `height:0;` to `.site-navigation-fixed {display: none;}` could have
 worked. Or else you could have disabled the `site-navigation-fixed` class
 entirely in the JS file (removing three calls to `adjustScrollClass()`:
 lines 184, 225 and 232).

Ticket URL: <https://core.trac.wordpress.org/ticket/42276#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list