Is this the idea of highlighting the home page navigation?
Add the navigation id parameter to the a link of the navigation. When you click to submit to the background, the background will obtain the id, and then output it to the template, and then In the template, the parameters of the url and the variables output to the template are judged. If they are consistent, the highlighted style will be given?
jjJ2019-02-17 10:06:08
After receiving the data you passed and processing it in the background, return the data to the front desk and modify the highlight style based on judgment
悬镜司2019-02-16 15:31:16
$classid = isset($_GET['classid'])? $_GET['classid'] : 1;
$menu = array(1=>'Home',2 =>'Latest developments',3=>'News recommendation',4=>'Website message');
foreach($menu as $k=>$v){
if($classid==$k){
$on = 'class="on"';
}else{
$on = '' ;
}
echo '<li '.$on.'><a href="list.php?classid='.$k.'&id=1"> ;'.$v.'</a></li>';
}
After clicking the navigation jump, the classid parameter will be brought in. Use this Just judge the parameters!