Ver Mensaje Individual
  #5 (permalink)  
Antiguo 14/11/2012, 13:27
franjgg
 
Fecha de Ingreso: marzo-2007
Mensajes: 751
Antigüedad: 17 años, 2 meses
Puntos: 4
Respuesta: Elemento no coja el focus

el codigo seria este amigo


el css:
Código CSS:
Ver original
  1. .combo /* look&fell of scriptaculous select box*/  
  2. {
  3.   margin: 0px 0px 0px 60px;
  4.   font-family:Arial, Helvetica, sans-serif;
  5.   font-size:1pt;
  6.   /*font-weight:bold;*/
  7.   width:200px;
  8.   text-align:left;
  9.  
  10.     background-position:left top;
  11.     background-repeat:no-repeat;*/
  12.     background-color:transparent;
  13.   height:45px;
  14.   /*position:absolute;*/
  15.   cursor: pointer;
  16.   /*border-left:solid 2px #777777;*/
  17.   border-top:0px;
  18.     border-right:0px;
  19.     border-bottom:0px;
  20.     border-left:0px;   
  21.   color:#6e6e6e;
  22.     padding:5px 5px 5px 15px;
  23.   /*border-top-right-radius: 2px;
  24.   border-bottom-right-radius: 2px;*/   
  25.  
  26. }
  27.  
  28. .combo:visited/* look&fell of scriptaculous select box*/  
  29. {
  30.   margin: 0px 0px 0px 60px;
  31.   font-family:Arial, Helvetica, sans-serif;
  32.   font-size:1pt;
  33.   /*font-weight:bold;*/
  34.   width:200px;
  35.   text-align:left;
  36.  
  37.     background-position:left top;
  38.     background-repeat:no-repeat;*/
  39.     background-color:transparent;
  40.   height:45px;
  41.   /*position:absolute;*/
  42.   cursor: pointer;
  43.   /*border-left:solid 2px #777777;*/
  44.   border:solid 2px red;
  45.   color:#6e6e6e;
  46.     padding:5px 5px 5px 15px;
  47.   /*border-top-right-radius: 2px;
  48.   border-bottom-right-radius: 2px;*/   
  49.  
  50. }
  51.  
  52.  
  53. .combo:active/* look&fell of scriptaculous select box*/  
  54. {
  55.   margin: 0px 0px 0px 60px;
  56.   font-family:Arial, Helvetica, sans-serif;
  57.   font-size:1pt;
  58.   /*font-weight:bold;*/
  59.   width:200px;
  60.   text-align:left;
  61.  
  62.     background-position:left top;
  63.     background-repeat:no-repeat;*/
  64.     background-color:transparent;
  65.   height:45px;
  66.   /*position:absolute;*/
  67.   cursor: pointer;
  68.   /*border-left:solid 2px #777777;*/
  69.   border:solid 2px red;
  70.   color:#6e6e6e;
  71.     padding:5px 5px 5px 15px;
  72.   /*border-top-right-radius: 2px;
  73.   border-bottom-right-radius: 2px;*/   
  74.  
  75. }
  76.  
  77. .combo:focus /* look&fell of scriptaculous select box*/  
  78. {
  79.   margin: 0px 0px 0px 60px;
  80.   font-family:Arial, Helvetica, sans-serif;
  81.   font-size:1pt;
  82.   /*font-weight:bold;*/
  83.   width:200px;
  84.   text-align:left;
  85.  
  86.     background-position:left top;
  87.     background-repeat:no-repeat;*/
  88.     background-color:transparent;
  89.   height:45px;
  90.   /*position:absolute;*/
  91.   cursor: pointer;
  92.   /*border-left:solid 2px #777777;*/
  93.   border:solid 2px red;
  94.   color:#6e6e6e;
  95.     padding:5px 5px 5px 15px;
  96.   /*border-top-right-radius: 2px;
  97.   border-bottom-right-radius: 2px;*/   
  98.  
  99. }


El php
Código PHP:
Ver original
  1. echo '<select style="display: none; border:0px;" id="Categoria" name="Categoria" class="combo">';                    
  2.            echo '<option value="vacio"></option>';
  3.                      
  4.            $consulta = "SELECT DISTINCT Ncategoria, categoria, tabla FROM categorias";
  5.            $resultado = mysql_query($consulta, $con);
  6.        
  7.            while ($array = mysql_fetch_array($resultado)){
  8.                      if ( $array['tabla'] == $_SESSION['Categoria'] )
  9.                      {
  10.                      echo '<option class="select_option" value="index.php?page=puls&Categoria='.$array['tabla'].'" selected="selected" >'.$array['categoria'].'</option>';                           
  11.                              }
  12.                      else
  13.                      {
  14.                      //echo '<option class="select_option" value="'.$array['tabla'].'" >'.$array['categoria'].'</option>';
  15.                      echo '<option class="select_option" value="index.php?page=puls&Categoria='.$array['tabla'].'" >'.$array['categoria'].'</option>';                                   
  16.  
  17.                              }
  18.                    
  19.            }
  20.          
  21.            echo '</select>';

Es un select hecho con javascrit entonces cuando pulso sobre el para cambiar el valor coje el focus y cambia el border a red el problema esta cuando elijo una opcion del select en ese momento por alguna razon pierde el focus y cuando levanto el dedo al hacer click lo recuperar por lo que hace un parpadeo