Menu hover not work in many page
I have a menu like this:
- <div id="menu">
- <ul>
- <li><a href="" class="active tab">Home</a></li>
- <li><a href="about" class="tab">About</a></li>
- <li><a href="specials" class="tab">Specials</a></li>
- <li><a href="account" class="tab">Account</a></li>
- <li><a href="register" class="tab">Register</a></li>
- <li><a href="price" class="tab">Price</a></li>
- <li><a href="contact" class="tab">Contact</a></li>
- </ul>
- </div> <!-- end .menu -->
Per page has one, there are some page (home, about ... example). I wrote css and js, too. Here is my js:
- <head>
- <meta http-equiv="ContentType" content="text/html; charset=utf8" />
- <title>Hover Menu with jQuery and CSS</title>
- <link rel="stylesheet" type="text/css" href="style.css" />
- <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('a.tab').click(function() {
- $('.active').removeClass('active');
- $(this).addClass('active');
- });
- });
- </script>
- </head>
But when I click about link, contact link, ...etc and the code doesn't work.
I know that when I click link, js reload.
What should I do? Thanks in advanced.