Php 无限卷轴不适用于砌体?
我的博客使用的是砖石风格。我想给我的博客添加无限滚动条 我使用的是定制php代码,不使用任何框架 我尝试从以下网站使用无限滚动jquery: 这对我不起作用 这是我的代码:Php 无限卷轴不适用于砌体?,php,jquery,infinite-scroll,Php,Jquery,Infinite Scroll,我的博客使用的是砖石风格。我想给我的博客添加无限滚动条 我使用的是定制php代码,不使用任何框架 我尝试从以下网站使用无限滚动jquery: 这对我不起作用 这是我的代码: <div id="envor-posts-masonry"> <?php require 'blog_function.php'; $query = "Select * FROM article ORDER BY
<div id="envor-posts-masonry">
<?php
require 'blog_function.php';
$query = "Select * FROM article ORDER BY post_date DESC ";
$posts = get_posts($query);
foreach($posts as $post)
{
?>
<article class="post post-masonry">
<div class="inner">
<header>
<h3><i class="fa fa-pencil"></i> <a href="blog_single_view.php?post_id=<?php echo $post['post_id']; ?>"><?php echo $post['post_title']; ?></a></h3>
<p>posted on <a href="">
<?php
$timestamp = $post['post_date'];
echo $data = date('d-m-Y',strtotime($timestamp)); ?></a> <br> by <a href=""><?php echo $post['author']; ?></a></p>
</header>
<p><?php $content=$post['post_content'];
$string = strip_tags($content);
if (strlen($string) > 500) {
$stringCut = substr($string, 0, 500);
$string = substr($stringCut, 0, strrpos($stringCut, ' ')).'....';
}
echo $string;
?></p>
<p><a href="blog_single_view.php?post_id=<?php echo $post['post_id']; ?>" class="envor-btn envor-btn-small envor-btn-secondary-border">read the rest <i class="fa fa-arrow-circle-right"></i></a></p>
</div>
</article>
<?php
}
?>
有人能帮我吗
提前谢谢 你能发布你的HTML吗,尤其是包含posts块的代码?@jbnunn,当然可以。现在您也可以查看我的html代码了。
<script src="../js/jquery-ias.min.js"></script>
<script type="text/javascript">
$('document').ready(function() {
var $container = $('#posts-masonry');
$container.imagesLoaded(function() {
$container.masonry({
itemSelector: '.post-masonry',
isFitWidth: false,
isAnimated: true
})
});
$.ias({
container: '#posts-masonry',
item: '.post-masonry',
pagination: '#pagination',
next: '.next',
onLoadItems: function(items) {
var $newElems = jQuery(items).css({ opacity: 0 });
$newElems.imagesLoaded(function() {
$newElems.animate({ opacity: 1 });
$container.masonry('appended', $newElems, true);
});
return true;
},
});
$(window).resize(function() {
$container.masonry('bindResize');
});
});
</script>