简体   繁体   English

Angular 9 轮播 ngx-bootstrap

[英]Angular 9 carousel ngx-bootstrap

<carousel [isAnimated]="true" pauseOnFocus="true" showIndicators="false" ng-repeat="slide in slides" > <carousel [isAnimated]="true" pauseOnFocus="true" showIndicators="false" ng-repeat="slide in slides" >

</slide>
<slide>
<img src="assets/img/2.jpg" alt="" style="display: block; width: 100%;">
</slide>
<slide>
<img src="assets/img/3.jpg" alt="" style="display: block; width: 100%;">
</slide>
<slide>
<img src="assets/img/4.jpg" alt="" style="display: block; width: 100%;">
</slide>
<slide>
<img src="assets/img/5.jpg" alt="" style="display: block; width: 100%;">
</slide>

I want to change indicators.我想改变指标。 is it possible to change the shape and position of indicators?是否可以更改指标的形状和 position?

You can style anything of the carousel in the way you want.您可以按照自己的方式设计任何旋转木马的样式。 Either having a specific bootstrap theme or just adding css for the bootstrap specific classes and add or overwrite styling.要么具有特定的引导主题,要么只是为引导特定类添加 css 并添加或覆盖样式。 The important part here is that you need to have this be part of a global css sheet.这里的重要部分是您需要将其作为全局 css 表的一部分。

.carousel-indicators li {
    height: 30px;
    border-radius: 50%;
}

If you would want to move the indicators out of the actual carousel you could do:如果您想将指标移出实际轮播,您可以执行以下操作:

.carousel-indicators {
  bottom: -20px;
}

If you would want to not display indicators at all you could do:如果您不想显示指标,您可以这样做:

.carousel-indicators {
  display: none;
}

Just play around with the css values to get to the result you want to achieve.只需使用 css 值即可获得您想要达到的结果。

You might need to use !important on your css values to overwrite the existing ngx-bootstrap styling您可能需要在 css 值上使用!important来覆盖现有的 ngx-bootstrap 样式

use;important just before.使用;重要的是之前。 sign in any CSS statement in global style page.在全局样式页面中登录任何 CSS 语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM