Ngx-bootstrap: Carousel showing only first slide when using [itemsPerSlide]

Created on 30 Jul 2020  路  1Comment  路  Source: valor-software/ngx-bootstrap

Hi! I'm trying to use Carousel multilist but I only see the first slide, no matter the value I enter in the itemsPerSlide parameter.

I'm working on a project with the following libs versions:

  • "@angular/animations": "~10.0.0",
  • "@angular/common": "~10.0.0",
  • "@angular/compiler": "~10.0.0",
  • "@angular/core": "~10.0.0",
  • "@angular/forms": "~10.0.0",
  • "@angular/platform-browser": "~10.0.0",
  • "@angular/platform-browser-dynamic": "~10.0.0",
  • "@angular/router": "~10.0.0",
  • "bootstrap": "^4.5.0",
  • "ngx-bootstrap": "^5.6.1"

Looking if somebody already reported this issue, I stumbled upon with the following stackblitz which demonstrates the problem: https://stackblitz.com/edit/ngx-bs-test-nnmdmg. Angular versions vary slightly, but ngx-bootstrap seems to be the same. My understanding is that I should be seeing 3 images simultaneously?

comp(carousel)

Most helpful comment

Hi, I ran into the same problem. After digging around a bit and comparing my project against the demo, I think the problem is from an improper margin: .carousel-item { margin-right: -100% }

I fixed the issue by adding the following to my project css file:

.carousel-item {
    margin-right: 0;
}

Hope this helps until they get a proper fix released

>All comments

Hi, I ran into the same problem. After digging around a bit and comparing my project against the demo, I think the problem is from an improper margin: .carousel-item { margin-right: -100% }

I fixed the issue by adding the following to my project css file:

.carousel-item {
    margin-right: 0;
}

Hope this helps until they get a proper fix released

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YevheniiaMazur picture YevheniiaMazur  路  3Comments

tpiros picture tpiros  路  3Comments

ctrl-brk picture ctrl-brk  路  3Comments

RolfVeinoeSorensen picture RolfVeinoeSorensen  路  3Comments

tuoitrexuquang picture tuoitrexuquang  路  3Comments