Sathesh
Sathesh

Reputation: 41

superfish menu sub menu centered

I have centered the Superfish Navbar menu on the page but struggling to find a way to center the first level sub menu on the page.

I couldn't post an image here as I do not have 10 reputations.

Upvotes: 2

Views: 390

Answers (1)

Wassim Taher
Wassim Taher

Reputation: 966

Here's a good work-around:

Step 1: Create a Javascript function to displace the sub menu. Something like this:

function DisplaceSubMenu(myDistance){

 document.getElementById("mySubMenu").style.margin-left= -myDistance;

}

Remember: you have to give the un-ordered list an id of "mySubMenu".

Step 2: Call the Javascript function when hovering over "Home" or "Services" since they hold submenus. You make the same call, but pass the "myDistance" attribute as a custom distance (try & error). Here's an example:

<a href="/" class="sf-with-ul" onmouseover="DisplaceSubMenu(30);">Home</a>

Upvotes: 1

Related Questions