我在我的 Wordpress 和 vBulletin 中使用 Nivo Slider 和 iframe 。但是当我添加更多幻灯片时,导航项目符号向右转,不再居中。我只知道 CSS 没有 jquery。我怎么解决这个问题 ?
问问题
3079 次
2 回答
3
如果您在页面中使用多个基于默认主题的滑块实例,上述解决方案可能会成为问题。
可能的解决方案:
1> 在 nivo-controlNav 类前面加上您要更改的滑块的 id。例如:如果您有一个 id 为 nivoSlider123 的滑块,您应该将边距覆盖为:
jQuery('div#nivoSlider123 .nivo-controlNav').css('position:absolute;left:50%;bottom:-42px;margin-left:-40px;');
现在您可以在不影响其他滑块的情况下调整 margin-left 的值。
2> 使用更通用的css代码:
.theme-default .nivo-controlNav {
position:absolute;
bottom:-42px;
/*left:50%; margin-left:-40px;*/ /* Tweak this to center bullets */
width:100%;text-align:center;
}
.theme-default .nivo-controlNav a {
/*display:block;width:22px;height:22px;background:url(bullets.png) no-repeat;text-indent:-9999px;border:0;margin-right:3px;float:left;*/
display:inline-block !important; width:22px; height:22px; background:url(bullets.png) no-repeat; text-indent:-9999px; border:0; margin-right:3px;
}
希望这可以帮助。
于 2012-02-19T11:45:26.713 回答
1
查看主题的 css 文件。默认的将是主题/默认/默认.css。
找到它并按照它说的做:
.theme-default .nivo-controlNav {
position:absolute;
left:50%;
bottom:-42px;
margin-left:-40px; /* Tweak this to center bullets */
}
于 2011-10-17T00:49:17.257 回答