Home > php教程 > php手册 > tp内的导航高亮实现不需要eq标签

tp内的导航高亮实现不需要eq标签

WBOY
Release: 2016-06-07 11:45:35
Original
1010 people have browsed it

tp内的导航高亮实现不需要eq标签
假设代码是    <volist><br>        <a>a.text</a><br>     </volist>向我们实现这种导航的高亮 html通常是写eq去判断,加个类
那样导致代码很长不易读,其实可以用jQuery实现<script><br /> $(function(){<br /> var current_url = '!-SELF-!';<br /> $('.nav[href="'+current_url+'"]').addClass('user_current');<br /> })<br /> </script>如果是子页面想高亮通过接受参数的方式 /code/edit/id/61.html 可以改为 cate={$_GET.cate}

下面的href= 改为*=就可以用href包含参数的方式判断高亮了

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template