Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: improve explanation of the speed option #381

Merged
merged 2 commits into from
Oct 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
docs: Improve explanation of speed option
  • Loading branch information
SaizFerri committed Oct 9, 2022
commit ba5363903a3fd7eb4470db1536b48a1bd33397bf
6 changes: 4 additions & 2 deletions packages/embla-carousel-docs/src/content/pages/api/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ Enables infinite looping. Automatically falls back to false if slide content isn
### speed

Type: <BrandPrimaryText>`number`</BrandPrimaryText>
Default: <BrandSecondaryText>`10`</BrandSecondaryText>
Default: <BrandSecondaryText>`10`</BrandSecondaryText><br />
Recommended: <BrandSecondaryText>`1-20`</BrandSecondaryText>

Adjust scroll speed when triggered by any of the API methods. Higher numbers enables faster scrolling. Drag interactions are not affected because speed is then determined by the drag force.
Adjust scroll speed when triggered by any of the API methods. Higher numbers enables faster scrolling. Drag interactions are not affected because speed is then determined by the drag force.<br />
<b>Note: </b>The speed option is actually controlling the magnitude of the attraction force to the target (where the carousel is headed). Embla doesn't use simple transitions to scroll. Instead, it uses a simple physics simulation when scrolling.

### startIndex

Expand Down