- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 slick jQuery 插件创建一个产品 slider ,其中 slider 内容使用 js 填充,然后调用 slick 函数,
slider slider 似乎可以工作,但它显示了一些具有 .slick-cloned 类的空 slider
网站网址为
最后一个 slider 工作正常,但前两个 slider 工作正常,任何人都可以帮我解决这个问题
下面有一些用于 slider 的虚拟代码
<div class="sliderrs">
<div><h3>contents added by js</h3></div>
<div><h3>contents added by js</h3></div>
<div><h3>contents added by js</h3></div>
<div><h3>contents added by js</h3></div>
<div><h3>contents added by js</h3></div>
<div><h3>contents added by js</h3></div>
</div>
.
$(function(){
$('.sliderrs').slick({
slidesToShow: 3,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 2000,
});
});
最佳答案
Slick 的行为正如广告中所宣传的那样。这实际上是一个常见的用户错误。
这是您的起始标记:
<ul id="options-901-list" class="options-list">
<li><input type="checkbox" class="checkbox product-custom-option" onclick="opConfig.reloadPrice()" name="options[901][]" id="options_901_2" value="2051" price="100" /><span class="label"><label for="options_901_2">7UP - 10 tray's <span class="price-notice">+<span class="price">€ 100,00</span> (+<span class="price">€ 121,00</span> Incl. BTW)</span></label></span></li>
<li><input type="checkbox" class="checkbox product-custom-option" onclick="opConfig.reloadPrice()" name="options[901][]" id="options_901_3" value="2050" price="100" /><span class="label"><label for="options_901_3">Coca Cola - 10 tray's <span class="price-notice">+<span class="price">€ 100,00</span> (+<span class="price">€ 121,00</span> Incl. BTW)</span></label></span></li>
<li><input type="checkbox" class="checkbox product-custom-option" onclick="opConfig.reloadPrice()" name="options[901][]" id="options_901_4" value="2049" price="100" /><span class="label"><label for="options_901_4">Fanta - 10 tray's <span class="price-notice">+<span class="price">€ 100,00</span> (+<span class="price">€ 121,00</span> Incl. BTW)</span></label></span></li>
</ul>
然后在其上运行 optionextended_images.js 和这段代码:
case 'grid' :
this.dd.className = 'optionextended-' + this.layoutGroup + '-grid';
var ul = this.dd.down('ul');
Element.insert(ul, {'top': new Element('div').addClassName('spacer').update(' ')});
Element.insert(ul, {'bottom': new Element('div').addClassName('spacer').update(' ')});
break;
像这样留下你的标记:
<ul id="options-901-list" class="options-list">
<div class="spacer" aria-hidden="true"> </div>
<li class="" aria-hidden="true"><img src="http://www.prokitchen.nl/media/catalog/product/cache/1/thumbnail/100x100/9df78eab33525d08d6e5fb8d27136e95/7/u/7up_5.jpg" class="optionextended-image" onclick="optionExtended.actAsLabel(901, 2051)"><input type="checkbox" class="checkbox product-custom-option" onclick="opConfig.reloadPrice()" name="options[901][]" id="options_901_2" value="2051" price="100"><span class="label"><label for="options_901_2">7UP - 10 tray's <span class="price-notice">+<span class="price">€ 100,00</span> (+<span class="price">€ 121,00</span> Incl. BTW)</span></label></span></li>
<li class="" aria-hidden="true"><img src="http://www.prokitchen.nl/media/catalog/product/cache/1/thumbnail/100x100/9df78eab33525d08d6e5fb8d27136e95/c/o/cola_5.jpg" class="optionextended-image" onclick="optionExtended.actAsLabel(901, 2050)"><input type="checkbox" class="checkbox product-custom-option" onclick="opConfig.reloadPrice()" name="options[901][]" id="options_901_3" value="2050" price="100"><span class="label"><label for="options_901_3">Coca Cola - 10 tray's <span class="price-notice">+<span class="price">€ 100,00</span> (+<span class="price">€ 121,00</span> Incl. BTW)</span></label></span></li>
<li class="" aria-hidden="true"><img src="http://www.prokitchen.nl/media/catalog/product/cache/1/thumbnail/100x100/9df78eab33525d08d6e5fb8d27136e95/f/a/fanta_5.jpg" class="optionextended-image" onclick="optionExtended.actAsLabel(901, 2049)"><input type="checkbox" class="checkbox product-custom-option" onclick="opConfig.reloadPrice()" name="options[901][]" id="options_901_4" value="2049" price="100"><span class="label"><label for="options_901_4">Fanta - 10 tray's <span class="price-notice">+<span class="price">€ 100,00</span> (+<span class="price">€ 121,00</span> Incl. BTW)</span></label></span></li>
<div class="spacer" aria-hidden="true"> </div>
</ul>
Slick 的工作方式是获取指定容器的所有子容器并将它们转换为幻灯片。您看到的“空幻灯片”实际上是您要添加的间隔 div。
关于jQuery Slick Slider 显示一些空幻灯片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30650016/
这是非常非常令人沮丧的。一段时间以来,我一直在尝试使用 Slick,但障碍不断涌现。 Slick 的概念真的很棒,但是很难学,而且不像Scala,它没有“初学者”、“中级”和“高级”风格,各个阶段的人
我在 Event 上定义了一个可选的外键,它转到 EventType。我想查询所有事件,即使是那些具有 None (null) 事件类型的事件。这是在 Event 上定义的外键。 def eventT
Another question通过在“一”案例类 (Directorate) 中定义一个返回“多”类的 Seq 的方法来回答如何定义一对多关联(服务区)。但它没有解决问题的“双向”部分。 使用该示例
我有一个向表中添加日期列的要求,默认值是由 oracle 的 sysdate 设置的,如下所示 例子{...CREATED_ON DATE 默认系统日期 我想使用 slick table ddl 创建
当我设置 speed: 1000 , pauseOnHover工作正常,但一旦我将其设置为 speed: 10000 , pauseOnHover不能立即工作 - 它在几秒钟后工作。 代码: $('#
我正在 try catch Slick 3.x 中的 SQL 错误。下面的代码不打印任何内容,但如果在调试下跟踪,它工作正常(它打印失败)。这段代码有什么问题? object TestSlick ex
我正在 try catch Slick 3.x 中的 SQL 错误。下面的代码不打印任何内容,但如果在调试下跟踪,它工作正常(它打印失败)。这段代码有什么问题? object TestSlick ex
我一直在使用 Slick's insertOrUpdate since its release in 2.1版本没有任何问题。 现在我正在尝试提高我的代码性能,而 insertOrUpdate 是瓶颈
我有一个列类型为日期的表。此列接受空值,因此,我将其声明为一个选项(请参阅下面的字段 perDate)。问题显然是从/到 java.time.LocalDate 的隐式转换/java.sql.Date
我试图在拖动幻灯片时向 a 标签添加“slick active”类。该类在单击时应用,但无法弄清楚如何将其应用到其他类! 如果能帮助破译我的代码,我们将不胜感激! JS $(document).rea
我有透明背景的 slider ,我想在悬停中心 div 时为 slider 背景制作动画,但在 slider 移动后,悬停效果会卡在所有以前具有“光滑中心”类的幻灯片上。任何建议如何解决它? Sp 到
我使用 Slick 3.1 代码生成器来创建默认对象和特征 Tables.scala 下面的方法有效,但我想隐式或显式地将 UserRow 和 PasswordsRow 转换为 User 和 User
我正在使用 Slick Slider 和 Slider Syncing 选项。是否可以滚动“缩略图”(示例中为 .slider-nav)而不更改主图像(示例中为 .slider-for)? 我只想在您
似乎 vue-slick 还没有提供任何事件(afterChange、beforeChange、Swipe...)。就像 jQuery 版本一样。 我应该使用 MutationObserver 来监听
问题 我正在 WordPress 网站上设置一个灵活的 slider /轮播。一切工作/显示都很完美,但是 slider 已停止正确拖动。 我仍然可以用鼠标物理拖动 slider ,它会按应有的方式进
我正在尝试使用 slick 库实现 slider 同步。我有一组来自后端的名为 pictures 的图像。我遍历这些图像,将它们填充到我的 slider-for 和 slider-nav div 下。
不知何故,我无法正确使用 slick carousel ( http://kenwheeler.github.io/slick/ )。 我收到以下错误: Uncaught TypeError: $(.
我正在使用 AOS 在滚动条上显示 html 元素。它单独运行良好,但当我在包含 Slick slider 的页面上使用它时,应用 AOS 的元素不显示。元素被隐藏,如果有很多滚动,看起来浏览器向 A
我正在使用 AOS 在滚动条上显示 html 元素。它单独运行良好,但当我在包含 Slick slider 的页面上使用它时,应用 AOS 的元素不显示。元素被隐藏,如果有很多滚动,看起来浏览器向 A
在我测试slick.js 前端 slider 插件时,我发现在Chrome 浏览器中,有时导航点在class ".slick-dots li button:before" 突然变了 来自 内容:'•'
我是一名优秀的程序员,十分优秀!