search

Home  >  Q&A  >  body text

Problem with homepage navigation highlighting?

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?

小生我怕怕啊小生我怕怕啊2108 days ago1381

reply all(3)I'll reply

  • jjJ

    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

    reply
    0
  • 悬镜司

    悬镜司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!



    reply
    0
  • 小生我怕怕啊

    OK

    小生我怕怕啊 · 2019-02-16 23:42:28
  • Cancelreply