问题:如何让导航条中的样式对应访问的页面?

在myiee.com网站中,根据已经含有的框架内容,修改添加,

如果要实时确定访问的当前页,需要在页面跳转时从后台传递参数在模版中渲染。可以这样:

<div class="nav">

    <a href="index" id="one"><li>首页</li></a>

    <a href="second" id="two"><li>内容</li></a>

</div>

<script type="text/javascript>

$function(){

    $("#{$headnav}").addClass('here');//其中{$headnav}是从后台传递过来的参数,在页面中渲染
});

</script>


在后台的php页面中

$this->assign("headnav","one");

$this->display('index.html');


//其中header.html是包含在index页面中的,则每次加载页面时,在header页面中的当前导航样式对应的是后台传递过来的headnav