Answers for "menu active in php"

PHP
0

php show active page

<ul class="nav navbar-nav">
      <li class="<?= ($activePage == 'index') ? 'active':''; ?>"><a href="index.php">Home</a></li>
      <li class="<?= ($activePage == 'contact-us') ? 'active':''; ?>"><a href="contact-us.php">Contact</a></li>
</ul>
Posted by: Guest on October-03-2020
0

php show active page

$activePage = basename($_SERVER['PHP_SELF'], ".php");
Posted by: Guest on October-03-2020
0

menu active in php

<script>
    jQuery(function($){
        $('.menu ul li a').filter(function() {
        var locationUrl = window.location.href;
        var currentItemUrl = $(this).prop('href');

        return currentItemUrl === locationUrl;
        }).parent('li').addClass('active');
    });
</script>
Posted by: Guest on February-20-2022

Browse Popular Code Answers by Language