### Bug description

The "On this page" table of contents drop down menu sometimes glitches in and out when scrolling through a part of the page with margin elements.

Here's an example from the Quarto website: [https://quarto.org/docs/authoring/article-layout.html]()

with a screen recording of the behavior:

https://user-images.githubusercontent.com/25734232/185762861-22533a12-ac99-4b67-9fdf-993ec86a120c.mov


### `quarto check` Output

```
[✓] Checking Quarto installation......OK
      Version: 1.0.38
      Path: /Applications/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.12
      Path: /usr/local/opt/python@3.9/bin/python3.9
      Jupyter: 4.10.0
      Kernels: ir, julia-1.6, juliapro_v1.5.0-1-1.5, julia-1.5, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.1.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.1/Resources/library
      rmarkdown: 2.14

[✓] Checking Knitr engine render......OK
```

### `quarto tools check` Output

```
[✓] Inspecting tools

Tool         Status            Installed     Latest
chromium     Not installed     ---           869685
tinytex      Not installed     ---           v2022.08
```

### Checklist

- [X] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [X] included a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
- [X] documented the quarto version you're running, by pasting the output from running `quarto check` in the "Quarto Check Output" text area?
- [X] documented the version of the quarto tools you're running, by providing the output from running `quarto tools check` in the "Quarto Tools Check Output" text area?
- [X] documented the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
- [X] documented which operating system you're running? If on Linux, please provide the specific distribution as well.
- [X] upgraded to the latest version, including your versions of R, the RStudio IDE, and relevant R packages?
dragonstyle
2022-08-20T19:18:01Z
maxdrohde
bug duplicate verify-fixed
v1.1
closed
"On this page" menu glitches when scrolling through margin elements on page
https://github.com/quarto-dev/quarto-cli/issues/2019