2015-04-15 70 views
0

我想为我的网站做猫头鹰旋转木马滑块全屏。 这正是我需要的,可随时调整您的浏览器猫头鹰旋转木马全屏不起作用

这是我应得的

fiddle

$(document).ready(function() { 

    // carousel setup 
    $(".owl-carousel").owlCarousel({ 
    navigation : false, 
    slideSpeed : 300, 
    paginationSpeed : 400, 
    singleItem: true, 
    autoHeight: true, 
    afterMove: top_align, 
    }); 

    function top_align() { 
    $(window).scrollTop(0); 
    console.log('move'); 
    } 

}); 

有没有什么解决办法来解决呢?

THX

+0

这难道不是同样的问题 - http://stackoverflow.com/questions/29629780/owl-carousel-100-height –

+0

没有,猫头鹰旋转木马的最新版本是1.33 – Lukas

回答

1

试试这个:

html, body { 
    height: 100%; 
    margin: 0; 
} 

.owl-wrapper-outer { 
    height: 100% !important;  
} 

.owl-wrapper { 
    height: 100%; 
} 

.owl-item { 
    height: 100%; 
} 

.b-Amarelo { 
    height: 100%; 
} 

.owl-item h1 { 
    margin: 0; 
} 

演示:Fiddle

+0

无法谢谢足够多 – Lukas

+0

非常感谢! –

1

当使用%的高度,你要你的工作方式下的DOM链到你的子元素的高度应用。

另一种选择是利用vh单位。 100vh =窗口高度的100%。

只需添加100vh到.owl项目和你的div项目。

.owl-item, .item { 
    height: 100vh; 
} 

vh单元is defined as:包含块的视域的初始的高度的

等于1%。

相关问题