迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
模板標簽里面
模板文件:search_data.htmlURL地址:http://x001.75cms.com/index.php?s=news&c=search&keyword=青海
手機端滾動下拉加載更多內(nèi)容的時候,高亮關(guān)鍵詞的效果就沒有了,看了下異步請求的內(nèi)容,搞兩次替換徹底沒有了,但第一次加載的時候是可以高亮的。
晚上我看看,今天出門沒帶電腦
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
高亮關(guān)鍵詞的效果是怎么做到的呢,我調(diào)試默認模板并沒有高亮關(guān)鍵詞的效果
回復(fù)迅??蚣軇?chuàng)始人
{search module=MOD_DIR id=$searchid total=$sototal order=$params.order catid=$catid page=1 pagesize=10 urlrule=$urlrule} <li class="search-item clearfix"> <div class="search-content"> <h4 class="search-title"> <a title="{$t.title}" href="{$t.url}">{dr_keyword_highlight($t.title, $keyword)}</a> </h4> </div> <div class="search-post-foot"> <a href="{$t.url}"><i class="fa fa-calendar"></i> {$t.updatetime}</a> </div> </li> {/search}
search_data.html 文件 整體是這樣
<a title="{$t.title}" href="{$t.url}">{dr_keyword_highlight($t.title, $keyword)}</a>
search_data.html 里 這樣寫的,和pc模版里寫的是一樣的,但加載方式是不一樣的。
移動端不能這么寫了,需要改一下,你把移動端的下頁請求js發(fā)給我一下
回復(fù)迅睿框架創(chuàng)始人
<script> var Mpage=1; //滾動顯示更多 var scroll_get = true; //做個標志,不要反反復(fù)復(fù)的加載 $(document).ready(function () { $(window).scroll(function () { if (scroll_get==true && (400 + $(window).scrollTop())>($(document).height() - $(window).height())) { scroll_get = false; layer.msg('內(nèi)容加截中,請稍候',{time:1000}); dr_ajax_load_more(); } }); }); function dr_ajax_load_more(){ Mpage++; $.get('/index.php?s=api&c=api&m=template&name=search_data.html&module={MOD_DIR}&catid={$catid}&searchid={$searchid}&sototal={$sototal}&order={$params.order}&format=json&page='+Mpage+'&'+Math.random(),function(res){ $('.footer-cont').hide(); if(res.code==1){ if(res.msg==''){ layer.msg("已經(jīng)顯示完了",{time:500}); $('#is_ajax_btn').hide(); }else{ $('#content_list').append(res.msg); scroll_get = true; } }else{ layer.msg(res.msg,{time:2500}); } }, 'json'); } </script>
$.get('/index.php?s=api&c=api&m=template&name=search_data.html&keyword={$keyword}&module={MOD_DIR}&catid={$catid}&searchid={$searchid}&sototal={$sototal}&order={$params.order}&format=json&page='+Mpage+'&'+Math.random(),function(res){
第二處
{dr_keyword_highlight($t.title, $get.keyword)}
兩個文件修改一下
晚上我看看,今天出門沒帶電腦
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
高亮關(guān)鍵詞的效果是怎么做到的呢,我調(diào)試默認模板并沒有高亮關(guān)鍵詞的效果
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)迅??蚣軇?chuàng)始人
{search module=MOD_DIR id=$searchid total=$sototal order=$params.order catid=$catid page=1 pagesize=10 urlrule=$urlrule} <li class="search-item clearfix"> <div class="search-content"> <h4 class="search-title"> <a title="{$t.title}" href="{$t.url}">{dr_keyword_highlight($t.title, $keyword)}</a> </h4> </div> <div class="search-post-foot"> <a href="{$t.url}"><i class="fa fa-calendar"></i> {$t.updatetime}</a> </div> </li> {/search}search_data.html 文件 整體是這樣
<a title="{$t.title}" href="{$t.url}">{dr_keyword_highlight($t.title, $keyword)}</a>search_data.html 里 這樣寫的,和pc模版里寫的是一樣的,但加載方式是不一樣的。
移動端不能這么寫了,需要改一下,你把移動端的下頁請求js發(fā)給我一下
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)迅睿框架創(chuàng)始人
<script> var Mpage=1; //滾動顯示更多 var scroll_get = true; //做個標志,不要反反復(fù)復(fù)的加載 $(document).ready(function () { $(window).scroll(function () { if (scroll_get==true && (400 + $(window).scrollTop())>($(document).height() - $(window).height())) { scroll_get = false; layer.msg('內(nèi)容加截中,請稍候',{time:1000}); dr_ajax_load_more(); } }); }); function dr_ajax_load_more(){ Mpage++; $.get('/index.php?s=api&c=api&m=template&name=search_data.html&module={MOD_DIR}&catid={$catid}&searchid={$searchid}&sototal={$sototal}&order={$params.order}&format=json&page='+Mpage+'&'+Math.random(),function(res){ $('.footer-cont').hide(); if(res.code==1){ if(res.msg==''){ layer.msg("已經(jīng)顯示完了",{time:500}); $('#is_ajax_btn').hide(); }else{ $('#content_list').append(res.msg); scroll_get = true; } }else{ layer.msg(res.msg,{time:2500}); } }, 'json'); } </script>$.get('/index.php?s=api&c=api&m=template&name=search_data.html&keyword={$keyword}&module={MOD_DIR}&catid={$catid}&searchid={$searchid}&sototal={$sototal}&order={$params.order}&format=json&page='+Mpage+'&'+Math.random(),function(res){第二處
{dr_keyword_highlight($t.title, $get.keyword)}兩個文件修改一下
開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!