【问题标题】:How to show carousel dots in AMP?如何在 AMP 中显示轮播点?
【发布时间】:2016-11-04 21:26:20
【问题描述】:
在这个轮播中,
我如何显示点?
<amp-carousel layout=fixed-height height=400 type=slides autoplay controls loop arrows dots='.'>
<amp-img src="img/slaid.jpg" layout=fixed-height height=400></amp-img>
<amp-img src="img/slaid.jpg" layout=fixed-height height=400></amp-img>
</amp-carousel>
【问题讨论】:
标签:
carousel
show
amp-html
【解决方案2】:
可以通过在 CSS 自定义属性 <style></style> 中指明来添加导航点。这是来自Styling/Theming with AMP 的 Github 示例:
<head>
<style>
amp-carousel {
--arrow-color: green;
--dots: {
opacity: 50%;
color: blue;
}
}
</style>
</head>
<body>
<amp-carousel width=500 height=500>
<div>
<amp-img width=500 height=500 src="https://placekitten.com/g/500/500">
</amp-img>
</div>
<div>
<amp-img width=500 height=500 src="https://placekitten.com/g/500/500">
</amp-img>
</div>
</amp-carousel>
</body>
您也可以查看此SO thread 以获取更多参考。