Split view

scrollSync() keeps a preview scrolled to the same fraction as the editor. It is one way, needs no markup in the document, and also re-aligns when the preview's content changes size. It is proportional: the two sides show roughly the same place, not the same block.


Editor and preview side by side

Scroll the editor; turn the switch off to let the preview stay where it is.

Chapter 1

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item

Chapter 2

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item

Chapter 3

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item

Chapter 4

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item

Chapter 5

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item

Chapter 6

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item

Chapter 7

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item

Chapter 8

Scroll the editor on the left: the preview follows, keeping the same fraction of its height in view. The two show roughly the same place, not the same block — a table or a video can be taller on one side than on the other.

The sync is one way, from the editor to the preview, and it also re-aligns when the preview changes size.

  • A list item
  • Another list item