光滑滑块在移动设备上不可滚动

时间:2017-03-07 22:43:15

标签: html css wordpress

目前,我一直忙于编辑Wordpress主题(Bronx Drag& Drop)。我已经使用过这个主题,因为客户希望能够自己做出调整。

Slick Slider是一款仅在移动设备上展示的水平图片轮播,不会让用户将图片滚动到页面下方,因为它使用水平滑动来浏览图片。



<div id="product-images" class="carousel slick product-images slick-initialized slick-slider" data-navigation="true" data-autoplay="false" rel="gallery" data-columns="1" data-asnavfor="#product-thumbnails"><button type="button" class="slick-nav slick-prev slick-arrow" aria-disabled="false" style="display: block;"></button>
<div aria-live="polite" class="slick-list draggable"><div class="slick-track" style="opacity: 1; width: 5112px;" role="listbox"><figure itemprop="image" class="easyzoom is-ready slick-slide" data-variation="" style="width: 568px; position: relative; left: 0px; top: 0px; z-index: 998; opacity: 0; transition: opacity 1000ms ease;" tabindex="-1" role="option" aria-describedby="slick-slide10" data-slick-index="0" aria-hidden="true">
<a href="http://#2017/02/#_2076" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2076-640x700" title="#_2076"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide is-ready" data-variation="" style="width: 568px; position: relative; left: -568px; top: 0px; z-index: 998; opacity: 0; transition: opacity 1000ms ease;" tabindex="-1" role="option" aria-describedby="slick-slide11" data-slick-index="1" aria-hidden="true">
<a href="http://#2017/02/#_2077" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2077-640x700" title="#_2077"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide is-ready slick-current slick-active" data-variation="" style="width: 568px; position: relative; left: -1136px; top: 0px; z-index: 999; opacity: 1;" tabindex="-1" role="option" aria-describedby="slick-slide12" data-slick-index="2" aria-hidden="false">
<a href="http://#2017/02/#_2078" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="0"><# src="http://#2017/02/#_2078-640x700" title="#_2078"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide is-ready" data-variation="" style="width: 568px; position: relative; left: -1704px; top: 0px; z-index: 998; opacity: 0; transition: opacity 1000ms ease;" tabindex="-1" role="option" aria-describedby="slick-slide13" data-slick-index="3" aria-hidden="true">
<a href="http://#2017/02/#_2079" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2079-640x700" title="#_2079"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide" data-variation="" style="width: 568px; position: relative; left: -2272px; top: 0px; z-index: 998; opacity: 0;" tabindex="-1" role="option" aria-describedby="slick-slide14" data-slick-index="4" aria-hidden="true">
<a href="http://#2017/02/#_2080" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2080-640x700" title="#_2080"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide" data-variation="" style="width: 568px; position: relative; left: -2840px; top: 0px; z-index: 998; opacity: 0;" tabindex="-1" role="option" aria-describedby="slick-slide15" data-slick-index="5" aria-hidden="true">
<a href="http://#2017/02/#_2081" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2081-640x700" title="#_2081"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide" data-variation="" style="width: 568px; position: relative; left: -3408px; top: 0px; z-index: 998; opacity: 0;" tabindex="-1" role="option" aria-describedby="slick-slide16" data-slick-index="6" aria-hidden="true">
<a href="http://#2017/02/#_2082" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2082-640x700" title="#_2082"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide" data-variation="" style="width: 568px; position: relative; left: -3976px; top: 0px; z-index: 998; opacity: 0;" tabindex="-1" role="option" aria-describedby="slick-slide17" data-slick-index="7" aria-hidden="true">
<a href="http://#2017/02/#_2083" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2083-640x700" title="#_2083"></a>
</figure><figure itemprop="image" class="easyzoom slick-slide" data-variation="" style="width: 568px; position: relative; left: -4544px; top: 0px; z-index: 998; opacity: 0;" tabindex="-1" role="option" aria-describedby="slick-slide18" data-slick-index="8" aria-hidden="true">
<a href="http://#2017/02/#_2084" itemprop="image" class="fresco" data-fresco-group="product_images" data-fresco-group-options="overflow: true" data-fresco-type="image" tabindex="-1"><# src="http://#2017/02/#_2084-640x700" title="#_2084"></a>
</figure></div></div><button type="button" class="slick-nav slick-next slick-arrow" style="display: block;" aria-disabled="false"></button></div>
&#13;
&#13;
&#13;

我一直试图解决这个问题超过2个小时,但还没有找到解决方案。

欢迎所有帮助!

1 个答案:

答案 0 :(得分:1)

我有同样的问题,并将以下代码添加到我的CSS修复了问题:

.slick-slider {
touch-action: auto;
-ms-touch-action: auto;
}

您可以在此处找到有关此问题的更多信息:https://github.com/kenwheeler/slick/issues/449