Owl carousel next slide view

propcode

I'm using owl carousel 2.0 as a fullscreen slider. Example here: http://pixelbypixel.comli.com/

It's working well except for a detail: If the user resize the screen making it bigger, then part of the next slide/image is shown for some seconds: enter image description here

Is there any way I can fix it? For example this problem doesn't happen with this slider: http://archive.nicinabox.com/superslides/#1 but I need to use owl carousel in this case.

This is my markup:

<div class="owl-carousel-container">
    <div class="owl-carousel">
      <div>
        <div class="img-container" style="background:url('img/home-1.jpg') no-repeat center center;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;"></div>
      </div>
      <div>
        <div class="img-container" style="background:url('img/home-2.jpg') no-repeat center center;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;"></div>
      </div>
      <div>
        <div class="img-container" style="background:url('img/home-3.jpg') no-repeat center center;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;"></div>
      </div>
    </div>
</div>

CSS:

.owl-carousel-container {
  position: relative;
  width: 100%;
  height: 100% !important;
  background: #00ad9d;
}
.owl-carousel-container .owl-carousel {
  height: 100% !important;
  opacity: 0 !important;
  -webkit-transition: all 0.1s;
  -moz-transition: all 0.1s;
  transition: all 0.1s;
}
.owl-carousel-container .owl-carousel .owl-stage-outer {
  height: 100% !important;
}
.owl-carousel-container .owl-carousel .owl-stage-outer .owl-stage {
  height: 100% !important;
}
.owl-carousel-container .owl-carousel .owl-stage-outer .owl-stage .owl-item {
  height: 100% !important;
}
.owl-carousel-container .owl-carousel .owl-stage-outer .owl-stage .owl-item > div {
  width: 100%;
  height: 100%;
}
.owl-carousel-container .owl-carousel .owl-stage-outer .owl-stage .owl-item .container {
  height: 100%;
  position: relative;
  -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  transition: all 0.3s;
}
.owl-carousel-container .owl-carousel .owl-stage-outer .owl-stage .owl-item .container img {
  width: auto;
  position: absolute;
  right: 15px;
  /*top: 157px;*/
  height: 384px;
  top: 50%;
  margin-top: -177px;
}
.owl-carousel-container .owl-carousel .owl-stage-outer .owl-stage .owl-item div.img-container {
  width: 100%;
  height: 100%;
  position: absolute;
}

JS:

function owlCarousel(){

  var owl = $('.owl-carousel');

  $(".owl-carousel").owlCarousel({
    loop:true,
    nav:false,
    mouseDrag:true,
    touchDrag:false,
    autoplay:true,
    autoplayTimeout:6000,
    autoplaySpeed:600,
    autoplayHoverPause:false,
    onInitialize : function(element){
        owl.children().sort(function(){
            return Math.round(Math.random()) - 0.5;
        }).each(function(){
            $(this).appendTo(owl);
        });
    },
    responsive:{
        0:{
            items:1
        },
        600:{
            items:1
        },
        1000:{
            items:1
        }
    }
  });
}
max

Try adding this option:

responsiveRefreshRate: 10

Default is 200, which means that if you resize the window images respond after 200 miliseconds.

Example:

$('#carousel-1').owlCarousel({
  nav: true,
  dots: true,
  animateIn: 'zoomIn',
  animateOut: 'zoomOut',
  responsiveRefreshRate: 10,
  navText: false,
  responsive: {
    0: {
        items: 1
    },
    600: {
        items: 2
    },
    1000: {
        items: 4
    }
  }
});

But you can have performance issues if the site grows (I think, didn't tested it)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Slide 2 items in OWL Carousel

From Dev

Owl Carousel: Run function when last slide is reached

From Dev

Owl Carousel + URL + Slide Item Change

From Dev

Owl-carousel move direction (drag + Previous/Next clicks)

From Dev

jquery Owl Carousel: how to make current slide focused

From Dev

Show part of next and previous items with Owl Carousel 2.0

From Dev

Owl Carousel 2 beta , jump to a specific slide

From Dev

Owl carousel: jump to a slide with an certain id

From Dev

Next and Prev button will slides 2 items on OWL Carousel

From Dev

How to Reverse owl carousel slider slide from right to left

From Dev

Owl Carousel 2 - Get src of current slide

From Dev

Owl Carousel - Slide orders, skip straight to selected slide

From Dev

Owl Carousel 2 Navigation In Slide

From Dev

Owl-carousel: Displaying only one image per slide

From Dev

How to make a owl carousel with arrows instead of next previous

From Dev

next prev icon not work in owl carousel 2

From Dev

Slide the Owl Carousel Controls

From Dev

How to Slide all visible items in Owl Carousel instead of one using prev/next button

From Dev

OWL Carousel 2: URL Hash Navigation - Link to current slide

From Dev

Owl carousel having wrong Next and Previous label

From Dev

Owl Carousel: Run function when last slide is reached

From Dev

Owl-carousel move direction (drag + Previous/Next clicks)

From Dev

Pause HTML5 video in Owl Carousel on slide

From Dev

How to Slide all visible items in Owl Carousel instead of one using prev/next button

From Dev

Owl Carousel slides appear all as one slide

From Dev

Thumbnail for next and previous buttons owl carousel

From Dev

Bootstrap Carousel next slide adds below the previous slide

From Dev

Owl Carousel - Slide multiple carousels with just one dots carousel slide

From Dev

Owl Slider clicking on next previous triggers all other slider to slide

Related Related

  1. 1

    Slide 2 items in OWL Carousel

  2. 2

    Owl Carousel: Run function when last slide is reached

  3. 3

    Owl Carousel + URL + Slide Item Change

  4. 4

    Owl-carousel move direction (drag + Previous/Next clicks)

  5. 5

    jquery Owl Carousel: how to make current slide focused

  6. 6

    Show part of next and previous items with Owl Carousel 2.0

  7. 7

    Owl Carousel 2 beta , jump to a specific slide

  8. 8

    Owl carousel: jump to a slide with an certain id

  9. 9

    Next and Prev button will slides 2 items on OWL Carousel

  10. 10

    How to Reverse owl carousel slider slide from right to left

  11. 11

    Owl Carousel 2 - Get src of current slide

  12. 12

    Owl Carousel - Slide orders, skip straight to selected slide

  13. 13

    Owl Carousel 2 Navigation In Slide

  14. 14

    Owl-carousel: Displaying only one image per slide

  15. 15

    How to make a owl carousel with arrows instead of next previous

  16. 16

    next prev icon not work in owl carousel 2

  17. 17

    Slide the Owl Carousel Controls

  18. 18

    How to Slide all visible items in Owl Carousel instead of one using prev/next button

  19. 19

    OWL Carousel 2: URL Hash Navigation - Link to current slide

  20. 20

    Owl carousel having wrong Next and Previous label

  21. 21

    Owl Carousel: Run function when last slide is reached

  22. 22

    Owl-carousel move direction (drag + Previous/Next clicks)

  23. 23

    Pause HTML5 video in Owl Carousel on slide

  24. 24

    How to Slide all visible items in Owl Carousel instead of one using prev/next button

  25. 25

    Owl Carousel slides appear all as one slide

  26. 26

    Thumbnail for next and previous buttons owl carousel

  27. 27

    Bootstrap Carousel next slide adds below the previous slide

  28. 28

    Owl Carousel - Slide multiple carousels with just one dots carousel slide

  29. 29

    Owl Slider clicking on next previous triggers all other slider to slide

HotTag

Archive