dedecms织梦channel子栏目导航标签currentstyle鼠标点击高亮变色加class样式 。
<style>
.red2{color:red;}
</style>
如果点击了其他页面不加class='red2',当点击或者首次打开首页的时候会加class
Markup
<li {dede:field name=typeid runphp="yes"}(@me=="")? @me=" class='red2'":@me="";{/dede:field}><a href='{dede:global.cfg_basehost/}'>首页</a></li>
如果点击了其中的一个栏目则则这个栏目增加class='red2'变色
Markup
{dede:channel type='top' row='8' currentstyle="<li class='red2'><a href='~typelink~' >~typename~</a> </li>" }
<li><a href="[field:typelink/]">[field:typename/]</a></li>
{/dede:channel}
注意:
如果是子栏目currentstyle这个标签是不生效的。需要改个配置
currentstyle无效的修复办法:
修改include/taglib/channel.lib.php
133行。
PHP
if( ($row['id']==$typeid || ($topid==$row['id'] && $type=='top') ) && $currentstyle!='' )
修改为
PHP
if( ($row['id']==$refObj->TypeLink->TypeInfos['id'] || ($topid==$row['id'] && $type=='top') ) && $currentstyle!='' )
下面是子栏目currentstyle的调用
Markup
{dede:channel typeid='3' currentstyle="<li class='red2'><a href='~typelink~' >~typename~</a> </li>" }
<li><a href="[field:typelink/]">[field:typename/]</a></li>
{/dede:channel}
2、本站永久网址:https://www.yuanmacun.com
3、本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长进行删除处理。
4、本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
5、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6、本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
源码村资源网 » 织梦channel子栏目导航标签currentstyle鼠标点击高亮变色加