【问题标题】:How to make Cycle(JQuery plugin) slider only images, not Div tags如何使 Cycle(JQuery 插件)滑块只有图像,而不是 Div 标签
【发布时间】:2012-12-07 18:30:54
【问题描述】:

如何使 Cycle(JQuery 插件) 滑块只有图像,而不是 Div 标签

例如:

<div id="banner">
 <img />
 <img />
 <img />

<div class="description">

</div>


</div>

我只想滑动img标签,不滑动描述块的div

【问题讨论】:

  • Cycle 旨在抓取​​包含元素内的所有内容。您的解决方案应该是将.description.banner 中删除。
  • Cycle 没有内置的方法来仅针对特定的孩子,而是选择所有孩子。更好的解决方案是简单地将 .description div 放在其他地方。

标签: javascript jquery html jquery-cycle


【解决方案1】:

不知道你是否还需要这个,但我建议升级到Cycle2。它在很大程度上应该是一个替代品,并且 Cycle2 具有“slides”属性,它允许您选择要制作成幻灯片的子元素(默认为您放置 .cycle() 的容器的直接图像子元素)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多