Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/01/2011, 20:41
Avatar de chicohot20
chicohot20
 
Fecha de Ingreso: mayo-2009
Mensajes: 388
Antigüedad: 15 años
Puntos: 43
Respuesta: problema con menu vertical jquery

Este es el efecto que quieres lograr?
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
  3. <head><title>Buu</title>
  4. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  5. div#nav_menu {
  6.     width:200px;
  7.     height:auto;
  8.     overflow: hidden;
  9. }
  10. ul#nav {
  11.     margin:0;
  12.     padding:0;
  13.     list-style:none;
  14.     clear:left;
  15. }
  16. ul#nav li {
  17.     width:200px;
  18.     height:25px;
  19.     background-color:#d4e8e7;
  20.     font-family:Arial, Helvetica, sans-serif;
  21.     color:#ef7a1a;
  22.     font-size:14px;
  23.     margin-bottom:10px;
  24. }
  25.  
  26. ul#nav li a {
  27.     color:#b7733b;
  28.     display: block;
  29.     text-decoration:none;
  30.     background-color:  #EEEEEE;
  31.     padding: 5px 0px 0px 30px;
  32.     margin-left: 40px;
  33.     width: 200px;
  34.     height: 20px;
  35. }
  36.  
  37. ul#nav li a.active {
  38.     margin-left:70px;
  39. }
  40. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
  41. <script type="text/javascript" language="javascript">
  42. $(document).ready(function(){
  43.     $("#nav a").not(".active").hover(function(){                        
  44.         $(this).stop().animate({                        
  45.         marginLeft : "70px",
  46.       }, 500 );
  47.     },function(){
  48.         $(this).stop().animate({                  
  49.         marginLeft : "40px",
  50.       }, 500 );
  51.     });    
  52. });
  53.  
  54. </head>
  55. <div id="nav_menu">
  56. <ul id="nav">
  57.   <li><a href="#" class="active">Home</a></li>
  58.   <li><a href="#">Portfolio</a></li>
  59.   <li><a href="#">About</a></li>
  60.   <li><a href="#">Contact</a></li>
  61. </ul>
  62. </div>
  63. </body>
  64. </html>

Probado en: IE8, Opera 10, Firefox 3.6.8