The solution for empire cms to use js css to achieve the highlight effect of the current column is as follows:
1. Add the following code to the template page:
code The code is as follows:
<li><a id="nav_[!--id--]" href="[!--class.url--]#">link</a></li>
2.js part of the code is as follows:
The code is as follows:
<script> var cur_nav = document.getElementById("nav_" + [!--self.id--]); cur_nav.className = "cur"; </script>
3.css part of the code is as follows:
The code is as follows :
<style> #nav ul li a.cur { color:#FFF; background:#000; } </style>
Users can also adjust the css style according to their own preferences to achieve satisfactory results!
Recommended to study "Empire cms tutorial"
The above is the detailed content of How to use js+css to achieve the highlight effect of the current column in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!