Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

carousel element in different width #260

Open
chenleiv opened this issue Sep 4, 2023 · 1 comment
Open

carousel element in different width #260

chenleiv opened this issue Sep 4, 2023 · 1 comment

Comments

@chenleiv
Copy link

chenleiv commented Sep 4, 2023

Hi,
I have dynamic buttons that runs on the carousel, each button as different width and i want the owl-item will be in the same size of his child button.

image
image
image

all the slide in the same size no matter what the bouton size.
I tried to change the width on the scss and also to override from js. nothing works.

please help.
chen

@vitalii-andriiovskyi
Copy link
Owner

@chenleiv

Try with

customOptions: OwlOptions = {
     autoWidth: true,
   // ...
}
 <ng-template carouselSlide [id]="item.id" [width]="item.width">
          <div>Kramer India</div>
 </ng-template>

here [width]="item.width" should be the width of a button. Probably you will need to generate buttons before the library initialization to get buttons widths before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants