此代码需要在所有博客帖子的预览中重构为“动态”。
旋转木马的想法太简单了,相反,我希望让下一个按钮调用接下来的3篇博文。
我该怎么做?
我有资源说我应该称之为“echo”
<div class="blog-content-discussion glow-blue">
<div class="main-title">
All Discussions
</div>
<div class="row" style="margin-top:10px; display:flex;">
<?php
// create a back link if current page greater than 0
$curPage = 0;
if ($curPage == 0) {
?>
<div class="col-md-3">
<div class="img-box">
<img src="img/dog-paw.jpeg" height=25 width=25 />
</div>
<div><a href="prev" > <i class="fa fa-arrow-left" aria-hidden="true"></i></a></div>
此外,javascript无效
$('#users').delegate('#next').delegate('#next', 'click', function() {
$(this).html('Loading...'); // Loader message
$.ajax( {
url: this.href, // URL from next link
success: function(data) {
$('#discuss').after(data).remove();
}
});
return false;});
</div>
<?php
} else {
// otherwise leave the cell empty
//echo ' ';
}
while($row1=mysqli_fetch_array($res1))
{
?>
<div class="col-md-3">
<div class="img-box">
<img src="img/dog-paw.jpeg" height=100 width=100 />
</div>
<div><a href="showpost.php?post_id=<?php echo $row1['post_id'] ;?>"><?php echo $row1['post_owner']; ?></a></div>
</div>
<?php
}
?>
<div class="col-md-3">
<div class="img-box">
<img src="img/dog-paw.jpeg" height=25 width=25 />
</div>
<div><a href="next" ><i class="fa fa-arrow-right" aria-hidden="true"></i></a></div>
</div>
</div>
</div>