Home  >  Article  >  php教程  >  网站栏目导航当前页高亮设计

网站栏目导航当前页高亮设计

PHP中文网
PHP中文网Original
2016-05-25 17:05:381127browse

网站当前页是指用户当前浏览的网页,那么在当前页在导航栏中进行高亮显示,与其它页进行区,这种当前页设计的细节体现,增加了用户体验,代码也很简单,这里展示的代码是帝国ecms中用到的. 代码中的$cu="cu"; 指的是当前页的css样式,
方法:将以下代码复制到帝国后以模板变量中的[!--temp.header--]中,同时在css中将.cu的样式与其它样式区别开来。

1. [代码]帝国ecms一级栏目导航高亮显示  

[e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=0 order by myorder,classid asc",0,24,0}]
<?php
$classurl=sys_ReturnBqClassname($bqr,9);
$cu="";
if($GLOBALS[navclassid])
{
$fcr=explode(&#39;|&#39;,$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];
if($bqr[classid]==$topbclassid)
{
$cu="cu";
}
}
?>

<li class="<?=$cu?>"><a href="<?=$classurl?>"><?=$bqr[classname]?></a></li>

[/e:loop]

                   

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn