My website is currently undergoing a major overhaul. I am looking to enhance its functionality, but I may have taken on more than I can handle.
You can find the link related to my query here:
On my top menu, there is a button located on the left side. It is styled using CSS and looks great. However, navigating through the menu is quite cumbersome, as it's easy to accidentally close the menu or submenus while moving the cursor.
I want users to be able to click on the button to open the navigation menu. Once opened, users should be able to move the cursor anywhere without the menu disappearing, unless they click outside the element or make a selection. Additionally, I want subsections to appear on the right that can be accessed by clicking, and moving the cursor away from the submenu should not make the main menu disappear. I have tried various solutions but have been unsuccessful so far due to my limited knowledge of jQuery and JavaScript.
Here is the HTML code I currently have:
<div id="navigation">
<ul id="nav">
<li><a href="#">Navigation</a>
<ul class="menu">
<li><a href="#">Professional</a>
<ul class="submenu">
<li><a href="#">Ambitions</a></li>
<li><a href="#">Resume</a></li>
<li><a href="#">Portfolio ></a></li>
</ul>
</li>
<li><a href="#">About Myself</a>
<ul class="submenu">
<li><a href="#">My Family</a></li>
<li><a href="#">Interests</a></li>
<li><a href="#">Scrap Book</a></li>
</ul>
</li>
<li><a href="#">Social Life</a>
<ul class="submenu">
<li><a href="#">Social Philosiphy</a></li>
<li><a href="#">My Networks ></a>
<ul class="submenu">
<li><a href="#" target="_blank">Facebook</a></li>
<li><a href="#" target="_blank">Google+</a></li>
<li><a href="#" target="_blank">Personal Tumblr</a></li>
<li><a href="#" target="_blank">YouTube</a></li>
<li><a href="#" target="_blank">Twitter</a></li>
<li><a href="#" target="_blank">Deviant Art</a></li>
<li><a href="#" target="_blank">Sound Cloud</a></li>
<li><a href="#" target="_blank">Github</a></li>
<li><a href="#" target="_blank">Diaspora</a></li>
<li><a href="#" target="_blank">MySpace</a></li>
<li><a href="#" target="_blank">about.me</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
Here is the CSS code for the menu:
#navigation {
width:300px;
height:40px;
float:left;
margin-top:-4px;
}
#navigation a {
margin:0px auto;
color:#ccc;
outline:none;
z-index:5;
}
#nav {
padding:7px 6px 10px 0px;
background:none;
line-height: 100%;
display:inline-block;
}
#nav li {
margin:0 0 0 5px;
padding:0 0 0 0px;
float:left;
position:relative;
list-style:none;
}
#nav a {
border-radius:20px 25px 0 10px;
border-top:solid 3px #fff;
border-left:solid 3px #fff;
font-weight:bold;
color:#fff;
background:none;
text-decoration:none;
display:block;
padding:8px 20px;
}
/* hovers and current tabs */
#nav a:hover {
border-radius:10px;
background:none;
color:#ccc;
}
#nav .current a {
border-radius:20px 25px 0 10px;
background:none;
color:#ccc;
margin-bottom:0px;
border-top:solid 3px #ccc;
border-left:solid 3px #ccc;
}
#nav li:hover > a {
border-radius:20px 25px 0 10px;
background:none;
color: #ccc;
margin-bottom:0px;
border-top: solid 3px #ccc;
border-left:solid 3px #ccc;
}
#nav ul li:hover a, #nav li:hover li a {
background:none;
border:none;
color:#333;
border-top:solid 1px #dfdfdf;
}
#nav ul a:hover {
color:black !important;
}
/* dropdown */
#nav li:hover > ul {
display:block;
background-color:#fff;
border-radius:10px 10px 10px 10px;
}
/* level 2 list */
#nav ul {
display:none;
margin: 0;
padding:0;
width:150px;
position:absolute;
top:33px;
left:0;
background:#aaa;
border:solid 1px #b4b4b4;
}
#nav ul:hover {
background-color:#ddd;
}
#nav ul li {
z-index:5;
font-weight:bold;
float:none;
margin:0px;
padding:0px;
}
#nav ul a {
font-weight:normal;
}