猫头鹰旋转木马,导航中心 [英] owl carousel, navigation center
本文介绍了猫头鹰旋转木马,导航中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是owl carousel插件,找不到如何使导航垂直对齐中心,以及选项autoHeight.
I use owl carousel plugin, can't find how to let navigation vertical align center, with option autoHeight.
http://codepen.io/anon/pen/jJAHL
我尝试如下进行操作,但只能达到最后的高度.
I tried like below, but it only get last height.
$(this_gallery).owlCarousel({
singleItem: true,
autoHeight : true,
navigation:true,
// autoPlay : 2000,
stopOnHover : true,
afterAction: function() {
var center_height = $(this_gallery).find('.owl-wrapper-outer').height();
console.log(center_height);
// $(this_gallery).find('.owl-buttons').css('top', center_height);
}
});
推荐答案
而不是在像素中给出top
position
,而在percentage
中给出它,如下所示:
Instead of giving top
position
in the pixel give it in the percentage
like following:
.owl-theme .owl-controls .owl-buttons .owl-prev {
left: -45px;
top: 45%;
}
这篇关于猫头鹰旋转木马,导航中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文