cerberus478 Posted November 2, 2011 Share Posted November 2, 2011 I would like to know how to make my links show that it's active. For example if I click on a link that says overview then that link has to be highlighted. This is the code that I have: <?php if (isset($this->_params['submenus']) && is_array($this->_params['submenus'])){ foreach ($this->_params['submenus'] as $submenu){ ?> <li class="active"><a href="<?php echo $this->get_uri("/{$submenu['controller']}/{$submenu['action']}") ?>" onclick="javascript:return setSubMenu(<?php echo $submenu['id'] ?>);"><?php echo strtoupper($submenu['name'])?></a></li> <?php } } ?> Unfortunately with this code all the links are selected as active. Quote Link to comment https://forums.phpfreaks.com/topic/250276-how-to-make-a-link-show-that-its-active/ Share on other sites More sharing options...
ocpaul20 Posted November 2, 2011 Share Posted November 2, 2011 Do you mean active - as in a tag css code? If so then you need to do this in style sheet part at the top of your page. Or do you want to highlight the link to show it is 'active'? In which case you still need to change the style in the css, a tags have several pseudo codes which affect them, maybe it is these you are trying to change? Or you can change the style dynamically with javascript if you want. Quote Link to comment https://forums.phpfreaks.com/topic/250276-how-to-make-a-link-show-that-its-active/#findComment-1284172 Share on other sites More sharing options...
cerberus478 Posted November 2, 2011 Author Share Posted November 2, 2011 How would I be able to do it in javascript Quote Link to comment https://forums.phpfreaks.com/topic/250276-how-to-make-a-link-show-that-its-active/#findComment-1284175 Share on other sites More sharing options...
ocpaul20 Posted November 2, 2011 Share Posted November 2, 2011 do a search on Google Quote Link to comment https://forums.phpfreaks.com/topic/250276-how-to-make-a-link-show-that-its-active/#findComment-1284186 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.