作者:ai琳伟_261 | 来源:互联网 | 2023-09-18 12:37
使用Flickity滑块时遇到问题;
事实是,滑块正好按我的意愿正好坐在那里...但是...
当我滑动后,它向左移动太多,并在其后留下大量空间;我看着
代码什么都没有出现;滑块的设置可能有问题?
Some Clients About us
{% if module.third.src %}
{% set sizeAttrs = ' ' %}
{% if module.third.size_type == 'auto' %}
{% set sizeAttrs = '' %}
{% elif module.third.size_type == 'auto_custom_max' %}
{% set sizeAttrs = ' ' %}
{% endif %}
![{{ module.third.alt }}]({{ module.third.src }})
{% endif %}
“Blue Label cared about the project is if it were their own. Showed a great interest in helping our company succeed. Would highly recommend for anyone looking for a job to be done the right way. They are not trying to cut corners and are worth every dollar spent.”
{% inline_text field="client_name" value="{{ module.client_name }}" %}
{% inline_text field="client_position" value="{{ module.client_position }}" %}
{% if module.third.src %}
{% set sizeAttrs = ' ' %}
{% if module.third.size_type == 'auto' %}
{% set sizeAttrs = '' %}
{% elif module.third.size_type == 'auto_custom_max' %}
{% set sizeAttrs = ' ' %}
{% endif %}
![{{ module.third.alt }}]({{ module.third.src }})
{% endif %}
“Blue Label cared about the project is if it were their own. Showed a great interest in helping our company succeed. Would highly recommend for anyone looking for a job to be done the right way. They are not trying to cut corners and are worth every dollar spent.”
{% inline_text field="client_name" value="{{ module.client_name }}" %}
{% inline_text field="client_position" value="{{ module.client_position }}" %}
{% if module.third.src %}
{% set sizeAttrs = ' ' %}
{% if module.third.size_type == 'auto' %}
{% set sizeAttrs = '' %}
{% elif module.third.size_type == 'auto_custom_max' %}
{% set sizeAttrs = ' ' %}
{% endif %}
![{{ module.third.alt }}]({{ module.third.src }})
{% endif %}
“Blue Label cared about the project is if it were their own. Showed a great interest in helping our company succeed. Would highly recommend for anyone looking for a job to be done the right way. They are not trying to cut corners and are worth every dollar spent.”
{% inline_text field="client_name" value="{{ module.client_name }}" %}
{% inline_text field="client_position" value="{{ module.client_position }}" %}
{% if module.third.src %}
{% set sizeAttrs = ' ' %}
{% if module.third.size_type == 'auto' %}
{% set sizeAttrs = '' %}
{% elif module.third.size_type == 'auto_custom_max' %}
{% set sizeAttrs = ' ' %}
{% endif %}
![{{ module.third.alt }}]({{ module.third.src }})
{% endif %}
“Blue Label cared about the project is if it were their own. Showed a great interest in helping our company succeed. Would highly recommend for anyone looking for a job to be done the right way. They are not trying to cut corners and are worth every dollar spent.”
{% inline_text field="client_name" value="{{ module.client_name }}" %}
{% inline_text field="client_position" value="{{ module.client_position }}" %}
{% if module.third.src %}
{% set sizeAttrs = ' ' %}
{% if module.third.size_type == 'auto' %}
{% set sizeAttrs = '' %}
{% elif module.third.size_type == 'auto_custom_max' %}
{% set sizeAttrs = ' ' %}
{% endif %}
![{{ module.third.alt }}]({{ module.third.src }})
{% endif %}
“Blue Label cared about the project is if it were their own. Showed a great interest in helping our company succeed. Would highly recommend for anyone looking for a job to be done the right way. They are not trying to cut corners and are worth every dollar spent.”
{% inline_text field="client_name" value="{{ module.client_name }}" %}
{% inline_text field="client_position" value="{{ module.client_position }}" %}
{% if module.third.src %}
{% set sizeAttrs = ' ' %}
{% if module.third.size_type == 'auto' %}
{% set sizeAttrs = '' %}
{% elif module.third.size_type == 'auto_custom_max' %}
{% set sizeAttrs = ' ' %}
{% endif %}
![{{ module.third.alt }}]({{ module.third.src }})
{% endif %}
“Blue Label cared about the project is if it were their own. Showed a great interest in helping our company succeed. Would highly recommend for anyone looking for a job to be done the right way. They are not trying to cut corners and are worth every dollar spent.”
{% inline_text field="client_name" value="{{ module.client_name }}" %}
{% inline_text field="client_position" value="{{ module.client_position }}" %}
{% if module.third.src %}
{% set sizeAttrs = ' ' %}
{% if module.third.size_type == 'auto' %}
{% set sizeAttrs = '' %}
{% elif module.third.size_type == 'auto_custom_max' %}
{% set sizeAttrs = ' ' %}
{% endif %}
![{{ module.third.alt }}]({{ module.third.src }})
{% endif %}
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries,but also the leap into electronic typesetting,remaining essentially unchanged. It was popularised in the 1960s with the
release of Letraset sheets containing Lorem Ipsum passages,and more recently
with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
LOREM
IPSUM
css:
.carousel-section{
width:100%;
height:90vh;
font-family: 'Montserrat',sans-serif;
background-color:#DFE6E9;
border-top:1px solid #c8cfd1;
display:flex;
flex-direction:column;
}
.carousel-wrapper{
width:100%;
height:90vh;
font-family: 'Montserrat',sans-serif;
background-color:#DFE6E9;
border-top:1px solid #c8cfd1;
display:flex;
flex-direction:column;
padding-left:10rem;
padding-top:5rem;
position:relative;
}
.carousel {
background: #DFE6E9;
margin-bottom:4rem;
position:absolute;
top:10rem;
left:0;
width:100%;
padding-left:10rem;
}
.carousel-cell {
width: 25%;
height: 330px;
margin-right: 10px;
display:flex;
flex-direction:column;
background: #DFE6E9;
padding:0 1rem 1rem 1rem;
align-items:flex-start;
border-right:1px solid #c8cfd1;
}
/* cell number */
.carousel-cell:before {
display: block;
text-align: center;
line-height: 200px;
font-size: 80px;
color: white;
}
.button {
font-size: 22px;
}
.button-group {
margin-bottom: 20px;
}
.carousel-cell-text p{
font-size:.8rem;
padding-right:2rem;
margin-top:2rem;
line-height:1.4rem;
}
.carousel-cell-clientinfo h5{
margin-top:1.2rem;
}
.carousel-cell-clientinfo h6{
font-size:.8rem;
font-weight:lighter;
margin-top:.5rem;
}
代码在CMS系统上,因此模块来自何处;此外,还有来自Flickity滑块的两个文件(css和Javascript)作为标准库连接到此模块。
![Flickity Slider问题与滑块在最后一次滑动后不断滚动而产生空间 Flickity Slider问题与滑块在最后一次滑动后不断滚动而产生空间](https://img.php1.cn/3cd4a/1eebe/cd5/3e641eb5f5c8cd90.webp)
在这里可以看到,在右侧,必须留有一定数量的空白,在此之前,滑块必须停止滚动才能使幻灯片占据整个区域,但是并不能停止...
就是这个问题...
尝试设置滑块父级的宽度。我最好的猜测是旋转木马,因为轻滑时按钮位于此容器中。或仅将轮播容器的尺寸限制在您用于定位的范围内。 CSS网格示例minmax(100%,400px)
,
在通过JS初始化Flickity时尝试使用此选项:
contain: true