How to force choice from drop-down items in a menu only?
-
I have drop-down menus at the horizontal navigation bar at the top of my blog (www.willworkforjustice.com). For several of the menu items, I want the user to be forced to choose from among the drop down items that show when the mouse hovers over the first item, but not to be able to actually click on that first item. For example, I don’t want them to be able to click directly on the “projects” button which takes them to a blank page, but rather have to choose from the kinds of projects listed in the drop-down menu below it.
Blog url: http://willworkforjustice.wordpress.com/ -
Yes, that is possible. You can do that by adding Custom Links as the top-level menu item (instead of using pages) and then have the sub-pages nested under the custom link.
The key is to use your blog URL as the custom link, and add # at the end of the link. You will still be able to click the menu item, but you won’t leave the page. The advantage of adding # at the end of the URL is that it won’t refresh the page when you click the link.
So the custom links for your menu would be: http://willworkforjustice.com/#
I went ahead and set this up for you in your Custom Menus page (Appearance > Menus). You can check out this screenshot – https://skitch.com/mkoenig/fgj4f/custom-links-menus.
We will add this to our support documentation at http://support.wordpress.com/menus/.
-
Thanks! Two follow up questions:
1. The two menu items edited now have a visual glitch. On the home page in this theme, the pink bar underneath all of the menu items is usually faded and brightens directly under a menu item only when the user mouses over it. After the edits, however, the bar is bright under both my edited “Teaching” and “Projects” menu items. Can this be fixed?
2. The way it is now set up, the static top-level menu headers are acting like a “home” button that takes the user to the landing page of my blog. Is there any way to edit them so that if clicked on nothing happens and the user remains on whatever page/blog-post they were on before?
-
Sorry about that. Instead of entering http://willworkforjustice.com/# what you actually wanted to enter was just #
This will make it so that the menu items aren’t highlighted. It will also set it up so that anybody visiting a post or page or on your site will remain on that post or page when clicking the menu item.
-
-
- The topic ‘How to force choice from drop-down items in a menu only?’ is closed to new replies.