javascript - Owl carousel full screen doesn't work - Stack Overflow

I am trying to make owl carousel slider full screen for my site.This is what I need, feel free to resi

I am trying to make owl carousel slider full screen for my site. This is what I need, feel free to resize Your browser

And this is what I have,

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');
  }

});

is there any solution to fix it?

Thx

I am trying to make owl carousel slider full screen for my site. This is what I need, feel free to resize Your browser

And this is what I have,

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');
  }

});

is there any solution to fix it?

Thx

Share Improve this question edited Jan 5, 2017 at 21:03 Aibrean 6,4221 gold badge23 silver badges38 bronze badges asked Apr 15, 2015 at 10:27 LukasLukas 1692 gold badges4 silver badges18 bronze badges 2
  • Isn't this the same question as - stackoverflow./questions/29629780/owl-carousel-100-height – Paulie_D Commented Apr 15, 2015 at 10:36
  • No, the current version of owl carousel is 1.33 – Lukas Commented Apr 15, 2015 at 10:43
Add a ment  | 

2 Answers 2

Reset to default 1

When using % for heights, you have to work your way down the DOM chain to your child element for the height to apply.

Another option is to take advantage of vh units. 100vh = 100% of the window height.

Just add 100vh to .owl-item and your div item.

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

A vh unit is defined as:

Equal to 1% of the height of the viewport's initial containing block.

Try this:

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;
}

Demo: Fiddle

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744873364a4598396.html

相关推荐

  • javascript - Owl carousel full screen doesn't work - Stack Overflow

    I am trying to make owl carousel slider full screen for my site.This is what I need, feel free to resi

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信