danielgarvin Posted July 19, 2010 Share Posted July 19, 2010 I have a navigation menu that is dynamic in wordpress. I am wanting to keep the rollover state active when viewing webpage Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/ Share on other sites More sharing options...
danielgarvin Posted July 19, 2010 Author Share Posted July 19, 2010 can anybody help? thanks Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/#findComment-1088183 Share on other sites More sharing options...
jd307 Posted July 19, 2010 Share Posted July 19, 2010 I am not 100% sure what you mean... but I will take a guess: Your menu has rollovers, e.g. it has a white background over the text but when the user mouses-over the text the background turns black... however when the user clicks, for example, the News link the news page opens but the menu is just as normal. You then want it so that if you are on the News page, the news link has a permanent black background? You would need to create a class in CSS for this and do some simple PHP checks to determine which page you are on, if (for example) the url is '?content=news', then your menu should reflect in the code that: if ($content == "news") { echo '<li class="menu_active">News</li>; } else { echo '<li class="menu_notactive">News</li>; } This is of course just an example. Is that what you are trying to achieve? Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/#findComment-1088186 Share on other sites More sharing options...
danielgarvin Posted July 19, 2010 Author Share Posted July 19, 2010 I know this is out of the topics for this forum but could i make a rollover state active using javascript such as onmouse out function Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/#findComment-1088198 Share on other sites More sharing options...
jd307 Posted July 19, 2010 Share Posted July 19, 2010 Maybe... You can extract the current URL with location.href and may be able to use document.getElementById. But you'd probably have to do document.write to load change the class attached to your menu item, which would mean writing <script> tags within other elements, which I do not think is valid (X)HTML. I am not a JavaScript person at all and generally try to avoid it... so it probably is possible. Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/#findComment-1088215 Share on other sites More sharing options...
danielgarvin Posted July 19, 2010 Author Share Posted July 19, 2010 what about making a rollover state active using css with a dynamic navigation? Is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/#findComment-1088218 Share on other sites More sharing options...
premiso Posted July 19, 2010 Share Posted July 19, 2010 can anybody help? thanks You re-post / bump after 3 minutes? Are you joking? If you want quick service pay someone. As far as why no one wants to answer your problem, with the exception of jd307, is that you failed to provide any code or any attempts you have tried. If you want to pay someone to do this, post in the freelance section, if you really want "help" to code this, well provide us with some code so we can assist you. But I assure you, your topic is not going to get resolved by not posting code and posting a 1 lined message of what you want to do and expect magic to happen. Is this possible? Sure it is possible, you just have to do your research on how, do not expect us to do your own research. A tip, googling for "CSS Active State" will bring up some good tutorials / how to's. Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/#findComment-1088224 Share on other sites More sharing options...
danielgarvin Posted July 19, 2010 Author Share Posted July 19, 2010 I have been doing research. I know how to make CSS Active State but not with a dynamic menu. I wouldn't be coming to a forum if I had found the solutions online. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/208192-making-rollover-state-active-with-dynamic-navigation/#findComment-1088227 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.