Problem with homepage navigation highlighting?
小生我怕怕啊
小生我怕怕啊 2019-02-14 19:57:42
0
3
1303

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?

小生我怕怕啊
小生我怕怕啊

http://hmgood.wonzan.com/

reply all (2)
jjJ

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

    悬镜司

    $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 '

  • ';

    }

    After clicking the navigation jump, the classid parameter will be brought in. Use this Just judge the parameters!



    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!