Jquery Effect only runs once, won't repeat
Hi, I'm making a website at
http://adc-design.com and I'm trying to create a menu using Jquery 1.3.2. Anyways, if you look at the tabs in my header, they have an effect but it only works once. After I mouse over the same tab a second time, they do not animate. I also have a similar menu at
http://adc-design.com/dev/index.html which uses drupal 1.4.2. You may notice the second menu also will fade to a darker gray. If i copy and past that code into my drupal block, it will still only animate one time. Do i need to include something extra because its version 1.3.2??? I also have another Jquery plugin below the header which is called a S3SLIDER. I'm not calling the jquery script up more than once.
Here's the code for the Jquery menu at adc-design.com:
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Nice Menu : CSS Animation & jQuery Animate</title>
- <link rel="stylesheet" type="text/css" media="screen, projection" href="/demo.css" />
- <script type="text/javascript" src="/modules/jquery_ui/jquery.ui/jquery-1.3.2.min.js"></script>
- <script type="text/javascript" src="/jquery.color.js"></script>
- <script type="text/javascript">
-
- $(document).ready(function() {
-
- $('#menu-jquery li a').hover(
-
- function() {
-
- $(this).css('padding', '6px 25px')
- .animate({'paddingLeft' : '50px',
- 'paddingRight' : '15px',
- 'backgroundColor':'rgba(0,0,0,0.5)'},
- 'fast');
- },
-
- function() {
-
- $(this).css('padding', '6px 25px')
- .animate({'paddingLeft' : '50px',
- 'paddingRight' : '15px',
- 'backgroundColor' :'rgba(0,0,0,0.2)'},
- 'fast');
-
- }).mousedown(function() {
-
- $(this).animate({'backgroundColor': 'rgba(0,0,0,0.1)'}, 'fast');
- }).mouseup(function() {
-
- $(this).animate({'backgroundColor': 'rgba(0,0,0,0.5)'}, 'fast');
- });
- });
-
- </script>
- </head>
- <body>
- <div id="container2">
- <div id="container">
- <ul id="menu-jquery">
- <li><a href="#">Home</a></li>
- <li><a href="#">About</a></li>
- <li><a href="#">Portfolio</a></li>
- <li><a href="#">Contact</a></li>
- </ul>
- </div>
- </BODY>
And here is the code for the menu that works properly:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Nice Menu : CSS Animation & jQuery Animate</title>
- <link rel="stylesheet" type="text/css" media="screen, projection" href="demo.css" />
- <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
- <script type="text/javascript" src="jquery.color.js"></script>
- <script type="text/javascript">
-
- $(document).ready(function() {
-
- $('#menu-jquery li a').hover(
-
- function() {
-
- $(this).css('padding', '2px 25px')
- .animate({'paddingLeft' : '40px',
- 'paddingRight' : '10px',
- 'backgroundColor':'rgba(0,0,0,0.5)'},
- 'fast');
- },
-
- function() {
-
- $(this).css('padding', '2px 20px')
- .animate({'paddingLeft' : '25px',
- 'paddingRight' : '25px',
- 'backgroundColor' :'rgba(0,0,0,0.2)'},
- 'fast');
-
- }).mousedown(function() {
-
- $(this).animate({'backgroundColor': 'rgba(0,0,0,0.1)'}, 'fast');
- }).mouseup(function() {
-
- $(this).animate({'backgroundColor': 'rgba(0,0,0,0.5)'}, 'fast');
- });
- });
-
- </script>
- </head>
- <body>
- <div id="container">
- <ul id="menu-jquery">
- <li><a href="#">Home</a></li>
- <li><a href="#">About</a></li>
- <li><a href="#">Portfolio</a></li>
- <li><a href="#">Contact</a></li>
- </ul>
- </BODY>
I do not know what to do, please help! thanks, austin.