我使用轮播来显示文章AMP
摘要列表。
出于某种原因,只有在页面加载时可见的摘要才有图片。
(如果我更多地旋转屏幕但没有加载所有图片。)
我究竟做错了什么?
随时询问更多信息。
这是布局:
<amp-carousel class="articles-carousel" layout="fixed-height" height="200" type="carousel">
<article role="button" tabindex="1" class="article-abstract" on="tap:AMP.setState({selectedArticle:1072}),AMP.scrollTo('id' = 'article_1072')">
<footer>
<amp-img height="128" layout="fixed" src="/server/929/rabbis/11.jpg" width="128"/>
<div class="article-abstract-author">
<address>
<a rel="author">הרב דוד חי הכהן</a>
</address>
</div>
</footer>
<header>
<a class="article-external-link-container" href="/929/307/1072" target="_blank">
<i class="fas fa-external-link-alt"/>
</a>
<h1>נקודות אור בימי אחאב(2)</h1>
</header>
</article>
<article role="button" tabindex="2" class="article-abstract" on="tap:AMP.setState({selectedArticle:1108}),AMP.scrollTo('id' = 'article_1108')">
<footer>
<amp-img height="128" layout="fixed" src="/server/929/rabbis/24.jpg" width="128"/>
<div class="article-abstract-author">
<address>
<a rel="author">הרב חיים בן סניור</a>
</address>
</div>
</footer>
<header>
<a class="article-external-link-container" href="/929/307/1108" target="_blank">
<i class="fas fa-external-link-alt"/>
</a>
<h1>מלחמת אחאב ובן הדד</h1>
</header>
</article>
<article role="button" tabindex="3" class="article-abstract" on="tap:AMP.setState({selectedArticle:1112}),AMP.scrollTo('id' = 'article_1112')">
<footer>
<amp-img height="128" layout="fixed" src="/server/929/rabbis/6.jpg" width="128"/>
<div class="article-abstract-author">
<address>
<a rel="author">הרב צבי שוויגר</a>
</address>
</div>
</footer>
<header>
<a class="article-external-link-container" href="/929/307/1112" target="_blank">
<i class="fas fa-external-link-alt"/>
</a>
<h1>המוותר על דברי נביא</h1>
</header>
</article>
<article role="button" tabindex="4" class="article-abstract" on="tap:AMP.setState({selectedArticle:1113}),AMP.scrollTo('id' = 'article_1113')">
<footer>
<amp-img height="128" layout="fixed" src="/server/929/rabbis/6.jpg" width="128"/>
<div class="article-abstract-author">
<address>
<a rel="author">הרב צבי שוויגר</a>
</address>
</div>
</footer>
<header>
<a class="article-external-link-container" href="/929/307/1113" target="_blank">
<i class="fas fa-external-link-alt"/>
</a>
<h1>עונש אחאב</h1>
</header>
</article>
</amp-carousel>
这是样式表:
.articles-carousel {
padding: 1em 0;
}
.article-abstract {
text-align: center;
vertical-align: text-top;
width: 155px;
height: 200px;
}
.article-abstract:focus {
outline: none;
}
.article-abstract:first-child {
margin-right: 12px;
}
.article-abstract header {
display: table;
width: 141px;
max-width: 100%;
}
.article-abstract h1 {
display: table-cell;
font-size: 12px;
line-break: normal;
margin: 0;
text-align: center;
width: 128px;
word-break: break-word;
white-space: normal;
}
.article-abstract footer {
display: inline-flex;
}
.article-abstract-author {
margin: 0px 3px 0 0;
max-width: 12px;
}
.article-abstract-author address {
transform: rotate(-90deg);
}
.article-abstract-author a {
font-size: 11px;
}
.article-external-link-container {
display: block;
width: 16px;
}
您可以看到只出现了四张图片中的三张:
更新:
Bachcha Singh 说这是一个错误。添加后:
.articles-carousel {
direction:ltr;
}
.articles-carousel > div * {
direction:rtl;
}
现在可以了。但是,我很乐意让它至少感觉像rtl
......说将初始位置设置为轮播结束。
更新#2: 似乎已在 amp-carousel-0.2 中解决。