akiran / akiran/react-slick

First slide delay when fade set to true

オープン
#1,343 コメント 4 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
11.9k
フォーク
2.1k
PR マージ指標
30日以内にマージされた PR はありません

説明

When the `fade` setting is `true`, the current slide is only set after the time defined in `autoplaySpeed`.

Here is my configuration:
```
var settings = {
dots: false,
lazyLoad: true,
infinite: true,
autoplay: true,
fade: true,
speed: 1000,
autoplaySpeed: 4000,
arrows: false,
}
```
By inspecting the DOM, I can verify that no slider is set as `slick-current` until the time elapsed in the configuration. Since all sliders have `opacity:0` and no current is selected, the slider does not show any images when loaded.

As a quick hack to prevent an empty slider, I force the opacity of the first slide.
```
.slick-track {
.slick-slide:first-child {
opacity: 1 !important;
}
}
```
This is less than ideal since on load, the first slide displays for twice the time as other slides.

Thanks.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。