迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費(fèi)且不限制商業(yè)使用,是免費(fèi)開源的產(chǎn)品,以萬端互聯(lián)為設(shè)計(jì)理念,支持的微信公眾號、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
模板標(biāo)簽里面
模板文件:search_data.htmlURL地址:http://x001.75cms.com/index.php?s=news&c=search&keyword=青海
手機(jī)端滾動(dòng)下拉加載更多內(nèi)容的時(shí)候,高亮關(guān)鍵詞的效果就沒有了,看了下異步請求的內(nèi)容,搞兩次替換徹底沒有了,但第一次加載的時(shí)候是可以高亮的。
晚上我看看,今天出門沒帶電腦
高亮關(guān)鍵詞的效果是怎么做到的呢,我調(diào)試默認(rèn)模板并沒有高亮關(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模版里寫的是一樣的,但加載方式是不一樣的。
移動(dòng)端不能這么寫了,需要改一下,你把移動(dòng)端的下頁請求js發(fā)給我一下
回復(fù)迅??蚣軇?chuàng)始人
<script> var Mpage=1; //滾動(dòng)顯示更多 var scroll_get = true; //做個(gè)標(biāo)志,不要反反復(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)}
兩個(gè)文件修改一下
晚上我看看,今天出門沒帶電腦
高亮關(guān)鍵詞的效果是怎么做到的呢,我調(diào)試默認(rèn)模板并沒有高亮關(guān)鍵詞的效果
回復(fù)迅睿框架創(chuàng)始人
search_data.html 文件 整體是這樣
search_data.html 里 這樣寫的,和pc模版里寫的是一樣的,但加載方式是不一樣的。
移動(dòng)端不能這么寫了,需要改一下,你把移動(dòng)端的下頁請求js發(fā)給我一下
回復(fù)迅??蚣軇?chuàng)始人
第二處
兩個(gè)文件修改一下