作者:赵 时间:2020-08-14 22:12:32
当前栏目高亮--调用eyoucms id
当前栏目id调用 解决中英文 栏目tid不一样的问题
{eyou:channelartlist typeid="1"}{eyou:field name='id' /}{/eyou:channelartlist}
{eyou:channelartlist}
<div class="url" id="{eyou:field name='id' /}"></div>
{/eyou:channelartlist}
<script type="text/javascript" src="{eyou:global name='web_templets_pc' /}/js/jquery.min.js"></script>
<script>
var url_id=$('.url').attr('id');
$('.nav-list li').each(function(index) {
var nav_list_id=$('.nav-list li').eq(index).attr('id');
if(url_id==nav_list_id){
$('.nav-list li').eq(index).addClass('active');
}
});
</script>