먼저 용기와 회전 목마를 포장 :
.myContainer {
position: fixed;
top: 0;
left: 0;
height: 100%;
width:100%;
}
<div class="myContainer">
<div class="myCarousel" (click)="navigate()"></div>
</div>
다음, 확인하는 것은 & 분 - 폭이 .slick- 0으로 설정 최소 높이 것입니다 슬라이더.
CSS : 기본 매끄러운 회전 목마 스타일의 변경이 마지막으로 초기화 할 때 당신은 응답 설정을 정의했는지 확인
// new definition
.slick-slider {
min-height: 1px;
min-width: 1px;
}
.slick-slide {
float: left;
[dir="rtl"] {
float: right;
}
img {
display: block;
}
&.slick-loading img {
display: none;
}
display: none;
&.dragging img {
pointer-events: none;
}
.slick-initialized {
display: block;
// set height and width
height: 100%; // helps to fix the loading issue when using flex-box - stretches slide vertically
width: 100% !important; // helps to fix the loading issue when using flex-box - shows slide upon load
}
.slick-loading {
visibility: hidden;
}
.slick-vertical {
display: block;
height: auto;
border: 1px solid transparent;
}
}
.slick-track {
position: relative;
left: 0;
top: 0;
display: block;
// set height
width: 100% !important; // helps to fix the loading issue when using flex-box
&:before,
&:after {
content: "";
display: table;
}
&:after {
clear: both;
}
.slick-loading {
visibility: hidden;
}
}
.slick-initialized {
display: block;
// set height and width
height: 100%; // helps to fix the loading issue when using flex-box - stretches slide vertically
width: 100% !important; // helps to fix the loading issue when using flex-box - shows slide upon load
}
.slick-loading {
visibility: hidden;
}
.slick-vertical {
display: block;
height: auto;
border: 1px solid transparent;
}
을 주석 노트 매끄러운 슬라이더 :
,
// initialize carousel
private initializeCarouselSettings(){
this.carousel.slick({
accessibility: false,
autoplay: false,
arrows: false,
slidesToShow: 1,
pauseOnHover: false,
pauseOnFocus: false,
draggable: false,
swipe: false,
touchMove: false,
centerMode: true,
fade: this.isTransitionTypeFade(),
autoplaySpeed: this.getSlideInterval(),
speed: this.getSpeedValue(),
responsive: [ // fixes the loading issue when using flex-box
{
breakpoint: 1024,
settings: {
mobileFirst: false,
infinite: true,
speed: this.getSpeedValue(),
slidesToShow: 1,
centerMode: true,
variableWidth: false,
focusOnSelect: false
}
}
]
});
}
당신의 &이 셀렉터의 사용을 설명 할 수 있습니까? . 슬레이트로드 중 { 표시 여부 : 숨김; } . 슬릭 - 수직 & { 디스플레이 : 블록; 신장 : 자동; 테두리 : 1 픽셀 단색 투명; } & nbsp; 셀렉터가 없을 때 나에게 어떤 의미도주지 않습니다. –
정확합니다. 일반적으로 &는 중첩 할 때 사용됩니다. 일반적으로 .some-class {& .another-class {}}와 같은 클래스 다음에 사용됩니다. 따라서, 중첩 클래스가없는 클래스의 & catch는 불필요합니다. – Tetrapike