我有一个 Caroufredsel slider ,使用示例中的“自定义”设置可以正常工作:
<script type='text/javascript'>
$(document).ready(function() {
// Using custom configuration
$("#random_selections").carouFredSel({
items : 3,
direction : "up",
/*wrapper: {
margin:0px,
},*/
scroll : {
items : 1,
easing : "elastic",
duration : 1000,
pauseOnHover : true
}
});
});
</script>
但是,顶部的图像与容器的顶部边框不齐平。如果我检查调试器,我会看到 .js 库中的级别有 CSS 样式:
<div class="caroufredsel_wrapper" style="display: block; text-align: start; float: none; position: relative; top: auto; right: auto; bottom: auto; left: auto; z-index: auto; width: 400px; height: 1387px; margin: 16px 0px; overflow: hidden;">
我发现这个特定元素是由 margin 属性控制的。如何在不更改库中代码的情况下调整此属性以反射(reflect)“边距:0px 0px”?有没有办法从外部做到这一点?
Caroufredsel 支持论坛上几乎没有事件,配置页面上也不清楚如何调整。
最佳答案
您可以在样式表中找到控制该元素的类,看看它是否是在那里生成的。也许你的类中有一些子元素正在覆盖你的内联 CSS
关于javascript - 如何调整 Caroufredsel slider 的上边距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19308275/