在 html 中我会有这样的东西
<div id="1" class="nivo-html-caption extraclass1">
一旦显示,它仍然会显示
<div class="nivo-caption" style="opacity: 0.8;">
它不会将我的类推送到 nivo-caption div,但我需要添加 extraclass1,有什么方法可以做到这一点吗?我需要为每个 nivo-caption div 添加一个不同的类。
最佳答案
您可以将标题嵌套在#htmlcaption div 中的另一个 div 中,而不是使用 jQuery 添加类:
<div id="htmlcaption" class="nivo-html-caption extraclass1">
<div class="extraclass1">
<em>HTML</em> caption
</div>
</div>
无论如何我都会这样做。
关于javascript - Nivo slider : add extra class to the nivo-caption div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6923415/