你是直接写在首页 ,跟 ,板块页,的源文件里的吗 ?还要不要引用其他的js代码?
下面是首页我更改后复制的代码那个"加载更多"a标签里的url地址要怎么输出,以及看还有那些地方帮忙修改一下。😂
<?php include _include(APP_PATH.'view/htm/header.inc.htm');?> <!--{hook index_start.htm}--> <div class="row"> <div class="col-lg-9 main"> <!--{hook index_main_start.htm}--> <div class="card card-threadlist"> <div class="card-header"> <ul class="nav nav-tabs card-header-tabs"> <li class="nav-item"> <a class="nav-link <?php echo $active == 'default' ? 'active' : '';?>" href="./<?php echo url("$route");?>"><?php echo lang('new_thread');?></a> </li> <!--{hook index_thread_list_nav_item_after.htm}--> </ul> </div> <div class="card-body"> <ul class="list-unstyled threadlist mb-0"> <!--{hook index_threadlist_before.htm}--> <?php include _include(APP_PATH.'view/htm/thread_list.inc.htm');?> <!--{hook index_threadlist_after.htm}--> </ul> </div> <a class="Button loadmore" style="display: inline-block;margin-bottom: 0;text-align: center;vertical-align: middle;cursor: pointer;white-space: nowrap; line-height: 20px;padding: 8px 13px;border-radius: 4px;user-select: none;color: #668c99; background: #e4f2f6; border: 0;" href="<?php $indexi='index-'.(intval($page)+1); echo url($indexi);?>">加载更多<span></span><span></span><span></span><span></span><span></span></a> <script type="text/javascript"> jQuery(document).ready(function($) { $('.loadmore').click(function() { $this = $(this); $this.addClass('loading_more').text('正在加载,请稍后。。。'); var href = $this.attr('href'); if (href != undefined) { $.ajax({ url: href, type: 'get', error: function(request) { $this.addClass('loading_error').text('加载失败'); }, success: function(data) { $this.removeClass('loading_more').text('加载更多'); var curpage = $('.pagination').find('.active').find('.page-link') .text(); curpage++; $('.pagination').find('.active').removeClass('active'); $('.pagination li').each(function() { if ($(this).text() == curpage) { $(this).addClass('active'); } }); var $res = $(data).find('.threadItem'); $('.threadlist').append($res.fadeIn(500)); var newhref = $(data).find('.nextpage').attr('href'); if (newhref != undefined) { $('.loadmore').attr('href', newhref); } else { $('.loadmore').remove(); } } }); } return false; }); }); </script> </div> <?php include _include(APP_PATH.'view/htm/thread_list_mod.inc.htm');?> <!--{hook index_page_before.htm}--> <nav class="my-3"><ul class="pagination justify-content-center flex-wrap"><?php echo $pagination; ?></ul></nav> <!--{hook index_page_end.htm}--> </div> <div class="col-lg-3 d-none d-lg-block aside"> <a role="button" class="btn btn-primary btn-block mb-3" href="<?php echo url('thread-create-'.$fid);?>"><?php echo lang('thread_create_new');?></a> <!--{hook index_site_brief_before.htm}--> <div class="card card-site-info"> <!--{hook index_site_brief_start.htm}--> <div class="m-3"> <h5 class="text-center"><?php echo $conf['sitename'];?></h5> <div class="small line-height-3"><?php echo $conf['sitebrief'];?></div> </div> <div class="card-footer p-2"> <table class="w-100 small"> <tr align="center"> <td> <span class="text-muted"><?php echo lang('threads');?></span><br> <b><?php echo $runtime['threads'];?></b> </td> <td> <span class="text-muted"><?php echo lang('posts');?></span><br> <b><?php echo $runtime['posts'];?></b> </td> <td> <span class="text-muted"><?php echo lang('users');?></span><br> <b><?php echo $runtime['users'];?></b> </td> <?php if($runtime['onlines'] > 0) { ?> <td> <span class="text-muted"><?php echo lang('online');?></span><br> <b><?php echo $runtime['onlines'];?></b> </td> <?php } ?> </tr> </table> </div> <!--{hook index_site_brief_end.htm}--> </div> <!--{hook index_site_brief_after.htm}--> </div> </div> <!--{hook index_end.htm}--> <?php include _include(APP_PATH.'view/htm/footer.inc.htm');?> <script> $('li[data-active="fid-0"]').addClass('active'); </script> <!--{hook index_js.htm}-->
请回帖者注意,与本贴无关的问题请重新发帖提问,以方便其他用户查找,谢谢配合!
看样子你已经弄好了
<?php $indexi='index-'.(intval($page)+1); echo url($indexi);?>
CF 看样子你已经弄好了 <?php $indexi='index-'.(intval($page)+1); echo url($indexi);?>
还是不行
点更加载多 能翻页了 js 好像没有生效不能实现无刷新加载. 帮忙看看代码都是复制你的
2732708273 还是不行 点更加载多 能翻页了 js 好像没有生效不能实现无刷新加载. 帮忙看看代码都是复制你的
看你的class名称,跟我这个应该不一样,要改
CF 看你的class名称,跟我这个应该不一样,要改
还是有难度啊
2732708273 还是有难度啊
所以你希望出一个插件?
CF 所以你希望出一个插件?
可以呀,做插件的话可以弄成自动加载
版块
人生倒计时
~扫~码~领~红~包~
请回帖者注意,与本贴无关的问题请重新发帖提问,以方便其他用户查找,谢谢配合!