2

我正在使用 angular-ui 引导轮播,并想用图像更改左右导航链接。似乎在 tpl 中它们被硬编码为 ‹ 和 ›

有没有人有任何建议将这些更改为图像而不更改实际的 angular-ui 引导文件?我想将它保存在库中,并且不想在每个版本发布后更改它。

我唯一的解决方案是在 CSS 中使这些尖括号的控制变得超级小,这样它们就无法被看到并放置图像。

.carousel-control {
  font-size: 1px
}

.carousel-control.left, carousel-control.right {
  background: url(/path/to/[image-here].png) no-repeat !important;
}

有更好的解决方案吗?

4

1 回答 1

3

http://angular-ui.github.io/bootstrap/项目的目标是拥有可自定义的模板,因此如果您不喜欢默认标记,可以将其换成您自己的。如果您想更改轮播的外观和感觉,我建议您覆盖默认模板(https://github.com/angular-ui/bootstrap/tree/master/template/carousel)。

您可以轻松地覆盖单个模板而不会弄乱,而不会触及项目的可交付成果,如下所述:https ://stackoverflow.com/a/17677437/1418796

于 2013-08-01T17:36:52.963 回答