- This topic is empty.
-
AuthorPosts
-
October 4, 2016 at 6:25 pm #246161
Anand_99
ParticipantHello,
I am developing the new site using WordPress. It’s a class project to develop school website. So I am referring to http://rgs.usu.edu/graduateschool/
On this website, if you click on “Tuition, Finances and Support” and then on “Tuition and Residency”, the new page opens up. How can I get the functionality to keep that menu expanded?I am a newbie, so it will be great if anyone can explain this in detail.
October 4, 2016 at 6:40 pm #246162I.m.learning
ParticipantWhat exactly are you looking for? Menus will keep expanding as long as the code provides.
From what i understand, once you add an anchor link with an href is when things change. This is regardless if the href leads to a link on that page or a separate page.
The only thing that comes to mind is you’re looking for a side menu to let users know where they are in your site.
October 4, 2016 at 6:46 pm #246163Anand_99
ParticipantWhat I want is left menu to be remain expanded after clicking the option in submenu.
For examples, after clicking on “Tuition, Finances and Support” and then “Tuition and Residency”, the previously opened menu of “Tuition, Finances and Support” goe closed. How can I keep that open/expanded? So that user can get clear idea of what menu->sub menu->page they are on to.
October 4, 2016 at 8:46 pm #246166Shikkediel
ParticipantThis is tricky because you’re actually going to another page. Most appropriate “tool” I can think of would be to use a session cookie with web storage.
With this you could save which menu is opened, read that info when landing on the new page and reopen the menu in question.
October 4, 2016 at 10:01 pm #246167deb
ParticipantI think you should use jquery like:
jQuery(‘.sub-menu li a’).click( function() {
jQuery(this).parent().parent().addClass(‘open’);
});and through css, you should do
ul.open { display: block !important; }I have not checked it, but I think it should work :)
Cheers !!!
October 4, 2016 at 10:29 pm #246169Shikkediel
ParticipantI believe that particular functionality is already there and that it’s more about keeping the menu open (on the redirected page) than the act of opening itself…
October 4, 2016 at 10:34 pm #246170deb
ParticipantOr the simple way is write this css:
.current-menu-parent ul.sub-menu { display: block !important }
October 4, 2016 at 10:44 pm #246171Shikkediel
ParticipantNot sure if trolling or just missing the point.
the new page opens up. How can I get the functionality to keep that menu expanded?
Any class added on the original page will not be “remembered” when landing on the redirected one.
October 4, 2016 at 10:47 pm #246172deb
ParticipantWordPress creates ‘current-menu-parent’ by default where ever the page redirects, we can inspect the elements, there will be ‘current-menu-parent’ class on active page. With the help of this class, we can show its child ul by:
.current-menu-parent ul.sub-menu { display: block !important }
October 4, 2016 at 11:10 pm #246173Shikkediel
ParticipantAh, that would be a nice solution then. Ignoring the jQuery.
November 4, 2016 at 6:30 pm #247512Anand_99
ParticipantThanks Deb,
I beleive this solution will be part of CSS and I am very new to CSS. So it will be great if you can help me with this. Where exactly do I need to put this code in? And is this generic solution or solution in my case, meaning do I need to use the exact this code or make some changes?
November 6, 2016 at 3:06 pm #247569deb
ParticipantYou can put this css in your stylesheet, it will work.
-
AuthorPosts
- The forum ‘Design’ is closed to new topics and replies.