0

i want a navigation where my main menu or parent links display as vertically like side bar and and when click some of them their sub menus should be shown horizontally in a different location! is that possible? actually i achieved that by doing one vertical menu on home page and when click a link from their it takes to the new page where i created a second navigation this time horizontally but now i don't want this that way because it creates problem on active state of links when pages loaded by ajax. any kind of solution with any library is also welcomed and already using jquery this is sample code.

<nav>
<ul>
    <li><a href="#Menu 1">Menu 1</a>
        <ul>
            <li><a href="#SubMenu 1.1">SubMenu 1.1</a></li>
            <li><a href="#SubMenu 1.2">SubMenu 1.2</a></li>
            <li><a href="#SubMenu 1.3">SubMenu 1.3</a></li>
            <li><a href="#SubMenu 1.4">SubMenu 1.4</a></li>
            <li><a href="#SubMenu 1.5">SubMenu 1.5</a></li>
            <li><a href="#SubMenu 1.6">SubMenu 1.6</a></li>
            <li><a href="#SubMenu 1.7">SubMenu 1.7</a></li>
            <li><a href="#SubMenu 1.8">SubMenu 1.8</a></li>
            <li><a href="#SubMenu 1.9">SubMenu 1.9</a></li>
            <li><a href="#SubMenu 1.10">SubMenu 1.10</a></li>
            <li><a href="#SubMenu 1.11">SubMenu 1.11</a></li>
            <li><a href="#SubMenu 1.12">SubMenu 1.12</a></li>
        </ul>
    </li>
    </ul>
    </nav>

this is the shot of what i did at first place. screenshot of site

now i also want my navigation to exactly the same but this time with one navigation as i said above. thanks

arcade
  • 213
  • 1
  • 13
  • Is the HTML fixed - does it have to be a nested unordered list like that? Since you want the submenu to show up somewhere else in your HTML,the easiest thing to do would be to just put the code for it where you want it to show up. – Anders Jul 26 '15 at 21:36
  • but i want my top level menu to remain active or highlighted even when i am on one of these sub menus and i think this is the essential part of any site right now when i clicked on the sub menus then top level menu lost its active state! – arcade Jul 26 '15 at 21:57
  • are you using any framework like bootstrap or pure html/css? – kishanio Aug 15 '15 at 01:05
  • no i am not using any framework! – arcade Aug 15 '15 at 01:07

0 Answers0