How to add a drop down menu to my webite
Hello everyone, I'm having trouble adding a drop down menu. After trying for hours to get it to work, I just finally restored my menu to the way it was and decided to ask for help.
I can give you more code if needed but here is my HTML for my menu
- <div class="menu-wrapper">
- <div class="menu">
- <ul>
- <li><a href="index.html" class="active">Home</a></li>
- <li><a href="about.html">About Us</a></li>
- <li><a href="tutorials.html">Tutorials</a></li>
- <ul><li><a href="tutorials.html">Testing 1</a></li></ul>
- <ul><li><a href="tutorials.html">Testing 2</a></li></ul>
- <ul><li><a href="tutorials.html">Testing 3</a></li></ul>
- <li><a href="contests.html">Contests</a></li>
- <li><a href="faq.html">FAQ</a></li>
- <li><a href="contact.html">Contact Us</a></li>
- </ul>
- </div>
- </div>
My CSS:
- .menu-wrapper{width:1000px; margin:0 auto; margin-top:116px; background:#2e3b4b; overflow:hidden;}
- .menu{width:634px; float:left; margin-top:20px; margin-left:20px; margin-bottom:20px}
- .menu ul li{float:left; width:100px; margin-right:4px;}
- .menu ul li a{width:100px; height:40px; line-height:40px; display:block; font-family: 'Open Sans', sans-serif; font-size:14px; color:#96577a; text-align:center; text-transform:uppercase;}
- .menu ul li a:hover{background:#96577a; color:#ffffff; width:100px; height:40px;}
- .menu ul li a.active{background:#96577a; color:#ffffff; width:100px; height:40px;}
My JS Code:
- $('menu ul li').hover(
- function() {
- $('ul', this).stop().slideDown(200);
- },
- function() {
- $('ul', this).stop().slideUp(200);
- }
- );
To make it clear I have my linked css file, jquery library, and js file in my page
- <!-- CSS File -->
- <link href="css/styles.css" rel="stylesheet" type="text/css" />
- <!-- Script element for jQuery Library -->
- <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
- <!-- Script element for Three Cats Design js -->
- <script src="js/threecatsdesign.js"></script>
I'm at lost and new to jQuery. Help would be very much appreciated.