0

这是我正在做的项目。如果你点击我网站上的博客,那么帖子就会显示出来。现在,如果您单击帖子,将显示该特定帖子的完整视图。但是,由于我在博客文章页面上应用了简单的分页,所以完整的文章视图只能在第一页上使用。以下是分页循环:

jQuery('#Pagination a').live('click', function(e) { //check when pagination link is clicked and stop its action.
    e.preventDefault();
    var link = jQuery(this).attr('href'); //Get the href attribute
    jQuery('#pcontent').fadeOut(500, function() { //fade out the content area
        jQuery("#loader").show(); // show the loader animation
    }).load(link + ' #pcontent', function() {
        jQuery("#loader").hide();
        jQuery('#pcontent').fadeIn(500, function() { //load data from the content area from paginator link page that we just get from the top
            //hide the loader
        });
    });
});

整页帖子视图是简单的 jquery show hide(隐藏其他所有内容并显示详细帖子)。

4

1 回答 1

1

好吧,我找不到能够快速加载完整帖子的 js 片段,但您可能已经将点击功能与 ie 绑定了。clickorbind函数。但是当加载新的 ajax 内容时(使用分页),这些处理程序不会被附加。请改用onorlive函数。

注意;您是否意识到屏幕高度较低(阅读:笔记本电脑)的用户因为没有滚动条而看不到分页?

于 2012-12-09T11:53:22.223 回答