I was following a dropdown menu tutorial:
What I really want to do is something like that, but to be able to make it so that when a user clicks on an item in the dropdown, then what the user clicked on is highlighted and even when the user moves the mouse away, the item the dropdown stays there and does not collapse to help give the user a frame of reference as to what page they are at. If the user selects another option in dropdown, then the previous one that the user clicked returns to normal and the new item the user clicked on gets highlighted.
How do I accomplish this either with jquery, javascript, or is there a way just with CSS3 and HTML5?
If I understand you correctly you would like the following to happen:
The main question here is whether the page will be reloading whenever the user clicks on an item, because the solution will be different depending on that.
Assuming the page will be reloading then you will need to make it so that when you page reloads the mark-up looks like this:
And you’ll need to change the CSS:
to:
and:
to:
And add the following line:
And then in the JavaScript change:
to:
I haven’t actually tested it out, so I’m sure you’ll have to do more than this to get a perfectly working solution, but I hope you can see the sort of thing I’m trying to do here.