python - 如何在 html 中添加加载更多按钮
问题描述
我正在尝试在我的 django 网站上创建一个加载更多帖子按钮。我希望首先显示 10 个帖子,然后在每 10 个帖子之后出现加载更多按钮,一次加载 10 个帖子。如果没有更多帖子要加载,我还希望加载更多按钮消失。使用下面的代码。
{% for act in acts %}
<div class="blog-item">
<div class="bi-pic">
<img src="{{act.image.url}}" alt="{{act.alt}} height="320" width="320"">
</div>
<div class="bi-text">
<div class="label">Article</div>
<ul></ul>
<div class="fp-text">
<h3>{{act.title}}</h3>
</div>
<ul>
<li>by <span>{{act.writter}}</span></li>
<li>{{act.date}}</li>
<li>20 Comment</li>
</ul>
<p>{{act.article | truncatechars:248}}
</p>
<div class="load-more-btn">
<a href="{{act.slug}}">read more</a>
</div>
</div>
</div>
{% endfor %}
解决方案
推荐阅读
- c# - 自定义 ProgressableStreamContent 不起作用
- ios - 保护 IOS 应用免受 Lucky Patcher 和其他此类应用的侵害
- flutter - 如何使用 Flutter_bloc 完美处理屏幕导航?
- angular - 选择复选框Angular中的所有项目
- c# - 将列表转换为二维数组 C#
- google-app-engine - 具有托管安全性的自定义域在 GAE 上获得过期证书
- rust - 有没有一种很好的方法来表示特征占位符类型的特征边界?
- php - laravel 多对多关系从数据透视表中获取数据
- django - Django 表单中的 Rise ValidationError
- spring - 生产中的 Spring Boot 2.x 应用程序:覆盖的文本资源文件应立即生效(页面重新加载后)