Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
OwlCarousel: Centered / Active element not set reliably

I'm using OwlCarousel 2.x with jQuery 3.x with pretty common settings, nothing too fancy, but sometimes the centered element is not reliably set to the .center CSS class.

I stripped down my own code to a minimal working example via JSFiddle: https://jsfiddle.net/5oLrz8d3/

     jQuery(document).ready(function() {
        jQuery('#matching_carousel').owlCarousel({
            stagePadding: 80,
            loop: true,
            margin: 20,
            items: 1,
            center: true,
            nav: false,
            responsive:{
                0:    {stagePadding: 80},
                700:  {stagePadding: 120},
                1200: {stagePadding: 170},
            }
        });
    });

Happens in Chrome (uBlock and stuff disabled) as well as Firefox or on Safari or mobile devices. If you drag/drop (via mouse or via touch on your mobile device), depending on how exactly you drop the element, sometimes the element in the center will not have the "center" css class. I mostly get it for the "carpet" image it seems.

As I'm graying and hiding some details of the non-centered elements via CSS, this obviously is quite buddy for the user. Looks like this:

enter image description here

Any clue what might cause the issue here and how to fix it?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!