How to disable Fly-out effect from Vertical Menu Bar?
In headway 3, the vertical menu bar at the sidebar no longer
list down all its sub-menu items like in Headway 2. But now it has a cool
fly-out sub-menu when hover over its main menu items. It works great and save a
lot of spaces but there is occasion when sub-menu items still need to be listed
down individually to allow direct navigation and quick accessibility.
Unfortunately, there is no direct way to disable the fly-out
effect in headway 3 but there is still a workaround. Follow the below steps to
do so.
Create Custom
Vertical Sub-Menu
- First, create your vertical menu in your WordPress dashboard.
- Go to Appearance > Menus, type in a menu name, for e.g. Submenu and click on “Create Menu” to create a menu.
- In the “Pages” panel, select and check on those pages you want them to appear on sub-menu bar.
- Click on “Add to Menu “ and the pages will now appear under the menu name you have created previously.
- Click on the green button “Save Menu” to save.
Create a Block for
Sub-Menu in Visual Editor
- Next, create a widget area block in Visual Editor where you want to place your vertical sub-menu.
(Note: If you are wondering why not a navigation
block instead of a widget area block because there is a custom menu widget available in widgets
that will help to achieve what we want.)
- Hover over the widget area block and take note of the widget ID.
- Go back to WordPress dashboard and click on Apperance > Widgets.
- Drag the “Custom Menu” to the Widget you have just created in Visual Editor.
- Make sure you are dragging into the widget which has the same ID as what you have created.
- In the “Custom Menu” panel, you can leave the title blank and select the menu name which is Submenu and click on “Save” button to save.
- When you view your page, you will see the sub-menu now appear on your web site but it may look a bit plain and raw. You have to style the sub-menu to give it a sleek look.
Style the Sub-Menu
- In the Headway visual editor, bring up the Live CSS editor and key in below CSS code.
- First, remove all the default formatting such as the bullets, indent spacing and underline of the sub-menu by adding the following CSS code.
/*STYLE
VERTICAL SUB-MENU*/
#block-31
li.widget ul, li.widget li { list-style:none; margin:10px 0 10px -10px; }
#block-31
li.widget { margin-left:-15px; }
#block-31
li.widget a { text-decoration:none; }
- Remember to change the block ID to your own block ID.
- To make the sub-menu more interesting, you can add a hover color while mouse over the individual menu items.
/*CHANGE
TEXT COLOR WHEN MOUSE OVER LINKS*/
#block-31
li.widget a:hover { background-color:#b60359; color:#ffffff; padding:5px; }
- You can even style the sub-menu main menu items and individual list items individually by defining a CSS class.
- For example, changing the size of the menu and the text of main menu items to uppercase.
- In addition, change the list items text to normal and add a border below each of them.
/*STYLE
THE VERTICAL SUBMENU TITLE INDIVIDUALLY*/
.submenu-title
{ font-weight:bold; text-transform:uppercase; font-size:13px; padding:10px 0
5px 0; }
.submenu-list
{ font-weight:normal; text-transform:capitalize; border-bottom:1px solid
#eeeeee; padding-bottom:7px; font-size:12px; }
- After defining the class, go back to WordPress dashboard.
- Go to Appearance > Menus and add the class name to the individual menu item and list items.
- The class name must be added to the “CSS classes” in the individual menu items.
- If it is not available, go to the top right hand corner and click on “Screen Option” to bring down more options.
- Check on “CSS Classes” and it will immediately show in the option panel.
- Type in “submenu-title” for the main menu items and “submenu-list” for the individual list items.
- Once it is done, click on the “save menu” to save.
- You will see the changes at your website.
There may be other way to disable a fly-out effect for
sub-menu but this is one of them so if you have better idea, please your
suggestion in the comment.
THANK YOU. I have been searching high and low for this, which I assumed to be a simple thing. And it was =)
ReplyDeleteNo problem. I glad it can help.
ReplyDelete