sul-cidr / noh

Noh as Intermedia
http://noh.stanford.edu/
MIT License
4 stars 2 forks source link

Improve L0 secondary navbar slide-in/out behavior on up scroll #572

Closed broadwell closed 4 years ago

broadwell commented 4 years ago

The code for the slide-in/out navbar is in src/assets/menu-scroll.js.

The offending behavior is that the secondary navbar menu, after having slid out at the beginning of an upward scroll (as desired), will unexpectedly and temporarily re-stow itself mid-scroll, especially on longer pages. Two likely triggers for this:

broadwell commented 4 years ago

Update: pretty sure the "noisy hardware" explanation is a red herring, although the fix in #575 does include code to ignore any scroll events of less than 1 pixel. The other, more self-evident causes of navbar misbehavior should be replicable on any machine. Here are instructions for producing them on /music/otsuzumi-kotsuzumi/:

  1. Scroll to the bottom of the page, then scroll up quickly and continuously. If you do it at a medium-fast pace, the sticky navbar should hide and unhide itself periodically during the scroll. Try gradually accelerating your up-scroll speed to trigger it.
  2. Click on the Strict and Flexible sidebar link, then click Rhythmic Organization. This will cause an upward jump-scroll of less than 100 pixels (on most devices), at which point the navbar will unhide, obscuring the top of the content you just jumped to. The behavior is more annoying with tab anchors, but this is an easy way to replicate it.