#84 : Validate autoplay duration value, add marquee demo
This commit is contained in:
@@ -129,6 +129,39 @@
|
|||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
## Marquee mode!anchorId:marquee-mode;
|
||||||
|
<Carousel
|
||||||
|
autoplayDuration={0}
|
||||||
|
duration={5000}
|
||||||
|
autoplay
|
||||||
|
timingFunction="linear"
|
||||||
|
dots={false}
|
||||||
|
arrows={false}
|
||||||
|
swiping={false}
|
||||||
|
>
|
||||||
|
{#each colors as { color, text } (color)}
|
||||||
|
<Color {color} {text} />
|
||||||
|
{/each}
|
||||||
|
</Carousel>
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
<Carousel
|
||||||
|
autoplayDuration={0}
|
||||||
|
duration={5000}
|
||||||
|
autoplay
|
||||||
|
timingFunction="linear"
|
||||||
|
dots={false}
|
||||||
|
arrows={false}
|
||||||
|
swiping={false}
|
||||||
|
>
|
||||||
|
{#each colors as { color, text } (color)}
|
||||||
|
<Color {color} {text} />
|
||||||
|
{/each}
|
||||||
|
</Carousel>
|
||||||
|
```
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
|
||||||
## Lazy loading of images!anchorId:features-lazy-loading;
|
## Lazy loading of images!anchorId:features-lazy-loading;
|
||||||
<Carousel
|
<Carousel
|
||||||
let:loaded
|
let:loaded
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export class ProgressManager {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.reset()
|
this.reset()
|
||||||
|
|
||||||
const stepMs = Math.min(STEP_MS, this._autoplayDuration)
|
const stepMs = Math.min(STEP_MS, Math.max(this._autoplayDuration, 1))
|
||||||
let progress = -stepMs
|
let progress = -stepMs
|
||||||
|
|
||||||
this._interval = setIntervalImmediate(async () => {
|
this._interval = setIntervalImmediate(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user