jQuery:任何 slider - 具有不同 CSS 样式的多个 slider

标签 jquery css anythingslider

我尝试在一个页面上使用 Anything Slider 的 3 个实例,但在为每个 slider 设置不同的样式时遇到问题。

slider 的 ID 为:slider1、slider2 和 slider3

因此,当我尝试以不同的方式设置 slider2 的一部分时,例如:

#slider2 .anythingSlider-default.activeSlider .anythingWindow {}

这不起作用。关于如何实现这一目标有什么想法吗?预先感谢您的时间和帮助。

最佳答案

希望我在 csstricks forums 中充分回答了您的问题。为了完整起见,再次如下:

Current versions of AnythingSlider have a theme option which allows you to change the style for each slider on a page. Then for the css, just add that theme name to the outer wrapper:

.anythingSlider-theme1 {}
.anythingSlider-theme1.activeSlider {}
.anythingSlider-theme1.activeSlider .anythingWindow {}
.anythingSlider-theme2 {}
.anythingSlider-theme2.activeSlider {}

etc...

You can't target the #slider2 ID because it is inside of .anythingWindow

关于jQuery:任何 slider - 具有不同 CSS 样式的多个 slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11270344/

相关文章:

php - 以编程方式设置网页的默认缩放?

javascript - 在 Anything Slider 下面添加一个文本框

jquery - 根据幻灯片内容更改幻灯片缩略图图标

使用 jquery 切换事件的 jquery 切换投票?

javascript - 如何获取所有带有 "click"事件的元素与 jQuery 相关联?

html - 页面加载时粘性标题崩溃

jquery - Anythingslider 问题 - 标题定位

javascript - 我需要从本地文件夹检索所有图像(无论数量和名称)并将其显示在我的网站上

javascript - .each jQuery 中的多个条件

javascript - 如何使用js查询Polymer中的shadow dom元素?