我使用样本中的“自定义”设置可以正常使用Caroufredsel滑块:
<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属性控制的。如何在不更改库中的代码的情况下调整此属性以反映“margin:0px 0px”?有没有办法在外部做到这一点?
Caroufredsel支持论坛中几乎没有活动,配置页面中不清楚如何调整它。
答案 0 :(得分:1)
您可以在样式表中找到控制该元素的类,看看它是否在那里生成。也许你的班级中有一些子元素会覆盖你的内联CSS