Foros del Web » Programando para Internet » Javascript »

problema con menu

Estas en el tema de problema con menu en el foro de Javascript en Foros del Web. hola a todos.. tengo un simple menu. el cual es un objeto que se desplaza al elemento del menu que seleccionemos, pero tengo problemas al ...
  #1 (permalink)  
Antiguo 15/08/2011, 13:14
Avatar de juan_14nob  
Fecha de Ingreso: abril-2010
Mensajes: 552
Antigüedad: 14 años
Puntos: 6
problema con menu

hola a todos.. tengo un simple menu. el cual es un objeto que se desplaza al elemento del menu que seleccionemos, pero tengo problemas al tratar de hacerlos bien en todos los navegadores especialmente en IE8.. este es el codigo:


Código HTML:
Ver original
  1. <style type="text/css">
  2. #opciones-menu{
  3.  
  4.     -moz-border-radius: 20px 20px 20px 20px;
  5.     background-repeat: repeat-y;
  6.  
  7.     height:20px;
  8.     left: 0;
  9.     position:relative;
  10.     top: 0;
  11.     margin:20px 0px 0px 0px;
  12.     padding-top:20px;
  13.     padding-bottom:20px;
  14.     width: 985px;
  15.  
  16.  
  17. }
  18. #opciones-menu ul{
  19.  
  20. }                                                                      
  21. #opciones-menu ul li{
  22.  
  23.     display:block;
  24.     float:left;
  25.     width:200px;
  26.     list-style:none;
  27.     margin-left:20px;
  28.     background: #11a5c0;
  29.     background: -webkit-gradient(linear, 0 0, 0 bottom, from(#EEFF99), to(#0f788c));
  30.     background: -webkit-linear-gradient(#11a5c0, #0f788c);
  31.     background: -moz-linear-gradient(top, #11a5c0 0%, #0f788c 100%);
  32.     background: -ms-linear-gradient(#11a5c0, #0f788c);
  33.     background: -o-linear-gradient(#11a5c0, #0f788c);
  34.     background: -ms-linear-gradient(top, #11a5c0 0%,#0f788c 100%); /* IE10+ */
  35.     background: linear-gradient(#11a5c0, #0f788c);
  36.     -pie-background: linear-gradient(#11a5c0, #0f788c);
  37.     behavior: url(PIE.htc);
  38. }
  39. #opciones-menu ul li a{
  40.     color:white;
  41.    
  42.     font-family:Trebuchet MS;
  43.     text-decoration:none;
  44. }
  45.  
  46. #opciones-menu ul li .home:hover{
  47.     color:#DA230A;
  48. }
  49.  
  50. #contenedor{
  51.     width:100%;
  52.  
  53. }
  54.  
  55. #barra_mov{
  56.     margin-left:440px;
  57.    
  58.     position:absolute;
  59.    
  60.     top:15px;
  61.     width:40px;
  62.     height:15px;
  63.     background: #87e0fd; /* Old browsers */
  64.     -moz-border-radius:10px 10px 10px 10px;
  65.     border-radius: 10px 10px 10px 10px;
  66.     behavior: url(PIE.htc);
  67. }
  68.  
  69. #barra_todo{
  70.    
  71.     position:relative;
  72.    
  73.     height:25px;
  74.     width:655px;
  75.     left:-32px;
  76.     margin:0px 0px 25px 0px;
  77.     margin-left:20px;
  78. }
  79.  
  80. <script src="jquery-1.5.js" type="text/javascript"></script>
  81.     <script type="text/javascript">
  82.     function mover(argumento){
  83.     var longitud = new Array(4);   
  84.    
  85.    
  86.         if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1){
  87.         longitud[0] = 10;
  88.         longitud[1] = 214;
  89.         longitud[2] = 440;
  90.         longitud[3] = 660;
  91.        
  92.        
  93.         }else if (navigator.appName.indexOf("Explorer") != -1) {
  94.         longitud[0] = -200;
  95.         longitud[1] = 214;
  96.         longitud[2] = 380;
  97.         longitud[3] = 660;
  98.         }else{
  99.                
  100.         longitud[0] = 0;
  101.         longitud[1] = 214;
  102.         longitud[2] = 440;
  103.         longitud[3] = 660;
  104.        
  105.         }
  106.         switch(argumento){
  107.             case 1:
  108.         //  var ultimo = longtud[0]+"%";
  109.             jQuery("#barra_mov").animate({
  110.        
  111.                 marginLeft: longitud[0]+"px"
  112.             },333 );
  113.            
  114.  
  115.            
  116.             break;
  117.             case 2:
  118.             jQuery("#barra_mov").animate({
  119.        
  120.                 marginLeft: longitud[1]+"px"
  121.             }, 333 );
  122.                 //sentencias
  123.            
  124.             break;
  125.             case 3:
  126.             jQuery("#barra_mov").animate({
  127.        
  128.                 marginLeft: longitud[2]+"px"
  129.             }, 333 );
  130.                 //sentencias
  131.             break;
  132.             default:
  133.             jQuery("#barra_mov").animate({
  134.        
  135.                 marginLeft: longitud[3]+"px"
  136.             }, 222 );
  137.                 //sentencias
  138.                    
  139.            
  140.         }
  141.    
  142.    
  143.     }
  144.    
  145.    
  146.     </script>
  147. </head>
  148. <div id="contenedor" align="center">
  149.     <div id="opciones-menu">
  150.         <ul>
  151.             <li><a id="hom" onmouseover="mover(1);" href="home.php">Home</a></li>
  152.             <li><a id="sol" onmouseover="mover(2);" href="#">Soluciones</a></li>
  153.             <li><a id="ser" onmouseover="mover(3);" href="javascript:void(0)">Servicios</a></li>
  154.             <li><a id="con" onmouseover="mover(4);" href="contac.php">Contacto</a></li>
  155.         </ul>  
  156.     </div>
  157.     <div id="barra_todo">
  158.         <div id="barra_mov" style=""></div>
  159.     </div>
  160. </div>
  161. </body>
  162. </html>

alguna sugerencia,consejo ??¿¿?

saludos y graciasss!!!

Etiquetas: html, js
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:08.