akiran / akiran/react-slick

Vertical mode slidesToShow not working

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

説明

When using the vertical mode option the slidesToShow option is ignored. I had to fix it with a fixed height on the slides children element. But I'd rather have it dynamic based on the height of the parent, where slick should calculate the height of the slides based on the parent..

Slider component
```
export const FeaturePartners = props => {
const { title, text, button, partners = partnersList } = props;

const slides = partners.map((partner, index) => {
return ;
});

return (



{title &&

{title}

}

{text &&
text.map((p, i) => {
return text.length !== i + 1 ? (

{p}


) : (


{p}


);
})}

{button && (

{button.text}

)}


{slides}



);
};
```

Slide component
```
export const Slide = props => {
const { filename, alt = '' } = props;

return (


{alt}

);
};
```

styles.module.scss:
```
.feature-partners {
background-color: var(--clr-black);
color: var(--clr-white);

&__container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: space-between;
}

&__title {
font-size: 7.2rem;
line-height: 8.5rem;
letter-spacing: 0.144rem;
margin: 0 0 2.5rem 0;
}

&__column {
width: 45%;
}

&__info {
padding: 10rem 0;
}

&__last-paragraph {
margin: 0 0 5rem 0;
}

&__slider-container {
position: relative;

&::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
z-index: 2;
background: rgb(26, 26, 26);
background: -moz-linear-gradient(
0deg,
rgba(26, 26, 26, 1) 0%,
rgba(26, 26, 26, 1) 10%,
rgba(26, 26, 26, 0) 15%,
rgba(26, 26, 26, 0) 85%,
rgba(26, 26, 26, 1) 90%,
rgba(26, 26, 26, 1) 100%
);
background: -webkit-linear-gradient(
0deg,
rgba(26, 26, 26, 1) 0%,
rgba(26, 26, 26, 1) 10%,
rgba(26, 26, 26, 0) 15%,
rgba(26, 26, 26, 0) 85%,
rgba(26, 26, 26, 1) 90%,
rgba(26, 26, 26, 1) 100%
);
background: linear-gradient(
0deg,
rgba(26, 26, 26, 1) 0%,
rgba(26, 26, 26, 1) 10%,
rgba(26, 26, 26, 0) 15%,
rgba(26, 26, 26, 0) 85%,
rgba(26, 26, 26, 1) 90%,
rgba(26, 26, 26, 1) 100%
);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#1a1a1a",endColorstr="#1a1a1a",GradientType=1);
}
}

&__slide-wrapper {
height: 33vh;
display: flex;
align-items: center;
justify-content: center;
}

&__slide-img {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center;
max-height: 20rem;
max-width: 25rem;
}
}
```

settings.js:
```
const settings = {
arrows: false,
dots: false,
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
vertical: true,
verticalSwiping: false,
swipe: false,
autoplay: true,
autoplaySpeed: 3000,
};

export default settings;
```

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

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

評価

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

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

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