本文介绍了我怎么分类=“活跃”我打开了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 <?php function getPagination($categories, $page, $totalPages){$pagination = "";if($page > 1){if($page == 2){$previousLink = $categories['CATEGORY_FILE_NAME'].".html";}else{$previousLink = $categories['CATEGORY_FILE_NAME']."-".($page-1).".html";}$pagination .= "<a href=\"https://india.com/".strtolower($previousLink)."\">Previous";}if($totalPages <= 5 OR $page < 3){if($totalPages > 5){ $totalPages = 5;}for($j = 1; $j<= $totalPages; $j++){if($j==1){$pagination .= "<a href=\"https://india.com/".$categories['CATEGORY_FILE_NAME'].".html\">$j";}else{$pagination .= "<a href=\"https://india.com/".$categories['CATEGORY_FILE_NAME']."-".$j.".html\">$j";}}}else if(($page+2) > $totalPages){for($j=($totalPages-4); $j<= $totalPages; $j++){if($j==1){$pagination .= "<a href=\"https://india.com/".$categories['CATEGORY_FILE_NAME'].".html\">$j";}else{$pagination .= "<a href=\"https://india.com/".$categories['CATEGORY_FILE_NAME']."-".$j.".html\">$j";}}}else{for($j=($page-2); $j <= ($page+2); $j++){if($j==1){$pagination .= "<a href=\"https://india.com/".$categories['CATEGORY_FILE_NAME'].".html\">$j";}else{$pagination .= "<a href=\"https://india.com/".$categories['CATEGORY_FILE_NAME']."-".$j.".html\">$j";}}}if($page < $totalPages){$pagination .= "<div class=\"col-xs-6\" style=\"padding:5px;\"><div style=\"float:right\"><a href=\"https://india.com/".$categories['CATEGORY_FILE_NAME']."-".($page+1).".html\">Next";}return $pagination;}?> 我尝试了什么: 请帮我,我尝试添加class =active(即如果我在第一页 - 一个号码将在分页中大胆.. < 1 2 3 4 5>(即1个数字将为粗体)如果我在第二页自动第二个数字将是粗体只有其他数字将是正常的What I have tried:please help me i try to add class="active" (i.e if i am in first page - one number will be bold in the pagination..< 1 2 3 4 5 > (i.e 1 number will be bold) if i am in second page automatically second number will be bold only othernumbers will be normal推荐答案 类别, 页面, totalPages){ totalPages){ 这篇关于我怎么分类=“活跃”我打开了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-24 16:51