Hi,
I have made a vertical menu using ul li & jQuery with some animate effect. Now what i want that when i mouse over to a link who have sub menu then it shows the sub menu and when mouse out it hide the sub menu of that link.
For example I have the following navigation menu
Home
About Us
->Profile
->Mission Statement
Services
Portfolio
Contact Us
When i mouse over to About us it shows me sub menu (Profile, Mission Statement)towar ds right. Can any one guide me how can I do this...?
Secondly when i mouse over the existing main menu i am giving it some animate effect and also try to change it's background color. It gives the animate effect but do not change the background color. Can you please also guide me in this regard as well.
Here is my Code of existing navigation
HTML
CSS
JavaScript
here is the Live demo of my work.
Kindly help me out to sort out my problem. I will be really thankful to you
I have made a vertical menu using ul li & jQuery with some animate effect. Now what i want that when i mouse over to a link who have sub menu then it shows the sub menu and when mouse out it hide the sub menu of that link.
For example I have the following navigation menu
Home
About Us
->Profile
->Mission Statement
Services
Portfolio
Contact Us
When i mouse over to About us it shows me sub menu (Profile, Mission Statement)towar ds right. Can any one guide me how can I do this...?
Secondly when i mouse over the existing main menu i am giving it some animate effect and also try to change it's background color. It gives the animate effect but do not change the background color. Can you please also guide me in this regard as well.
Here is my Code of existing navigation
HTML
Code:
<div id="sidebar">
<ul id="nav">
<li><a href="#.">Home</a></li>
<li><a href="#.">About Us</a></li>
<li><a href="#.">Services</a></li>
<li><a href="#.">Portfolio</a></li>
<li><a href="#.">Contact Us</a></li>
</ul>
</div>
Code:
#nav {
margin-top: 50px;
}
#nav {
list-style: none outside none;
margin: 73px 0 0 0;
overflow: hidden;
padding: 0;
position: relative;
text-align: right;
white-space: nowrap;
width: 275px;
z-index: 10;
}
#nav li {
height: 30px;
margin-bottom: 6px;
width: 275px;
}
#nav li a {
background: rgba(255, 255, 255, 0.11);
color: rgba(255, 255, 255, 0.65);
display: block;
float: right;
font: 14px/14px Arial,Helvetica,sans-serif;
letter-spacing: 1px;
padding: 8px 8px 6px 45px;
text-decoration: none;
width: auto;
}
Code:
$('#nav li').hover(
function () {
$(this).children().stop().animate(
{paddingLeft: 230, paddingRight: 15, backgroundColor: "#e01a33"}, { queue:false, duration:1000, easing: 'swing'}
);
},
function () {
$(this).children().stop().animate(
{paddingLeft: 45, paddingRight: 8, backgroundColor: "#e01a33"}, {queue:false, duration:600, easing: 'swing'}
);
}
);
Kindly help me out to sort out my problem. I will be really thankful to you
Comment