Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```php
- // the top level menu items are stored as an array
- $menuItems = array(' href="index.php">Home',
- ' href="activities.php">Activities',
- ' href="about.php">About',
- ' href="profile.php">My Profile',
- ' href="#" class="icon" id="menuicon" onclick="toggleClass(\'topnav\', \'menuicon\')"><b>≡</b>');
- // write the opening structure of the menu
- echo '<div id="topnav" class="menu">';
- // write the individual menu items
- $menuCount = count($menuItems);
- for ($i = 0; $i < $menuCount; $i++) {
- echo "\n<a";
- if ($section == $i) { // if an item is selected, add the correct class spec
- echo " class='selected'";
- }
- echo $menuItems[$i] . "</a>";
- }
- // write the closing structure of the menu
- echo "\n
- </div>";
- }
- ```
- That is where i build the menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement