我尝试在一个页面上使用 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/