Skip to content

Commit

Permalink
Update scrollIntoView() documentation to clarify inline alignment opt…
Browse files Browse the repository at this point in the history
…ions

- Clarified the usage of the  `inline` alignment options in the `scrollIntoView()` method.
- Added descriptions for horizontal (`inline`) alignment, including possible values and default behaviors.
  • Loading branch information
FelixTakeOne authored Nov 11, 2024
1 parent 4fbf43f commit 5df0ea8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions files/en-us/web/api/element/scrollintoview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ scrollIntoView(scrollIntoViewOptions)
edge, it will align to the bottom. This minimizes the scrolling distance.
- Defaults to `start`.
- `inline` {{optional_inline}}
- : Defines horizontal alignment.
One of `start`, `center`, `end`, or
`nearest`. Defaults to `nearest`.
- : Defines the horizontal alignment of the element within the scrollable ancestor container. This option is a string and accepts one of the following values:
- `start`: Aligns the element's left edge with the left of the scrollable container, making the element appear at the start of the visible area horizontally.
- `center`: Aligns the element horizontally at the center of the scrollable container, positioning it in the middle of the visible area.
- `end`: Aligns the element's right edge with the right of the scrollable container, placing the element at the end of the visible area horizontally.
- `nearest`: Scrolls the element to the nearest edge in the horizontal direction. If the element is closer to the left edge of the scrollable container, it will align to the left; if it's closer to the
right edge, it will align to the right. This minimizes the scrolling distance.
- Defaults to `nearest`.

### Return value

Expand Down

0 comments on commit 5df0ea8

Please sign in to comment.