2012-03-15 20 views
5

Por lo tanto, me gustaría mostrar un textarea en solo 1 fila.filas de jQuery Mobile y textarea

Pero jQuery Mobile no lo creo ... Lo que me puse valor en el atributo rows, siempre es la altura de 2 filas ...

¿Habría alguna solución?

Respuesta

11

El jQuery Mobile CSS establece una altura específica para textarea elementos:

textarea.ui-input-text { 
    height : 50px; 

    -webkit-transition : height 200ms linear; 
     -moz-transition : height 200ms linear; 
     -o-transition : height 200ms linear; 
      transition : height 200ms linear; 
} 

Usted puede crear su propia regla para anular esta altura a algo más sola línea:

.ui-page .ui-content .ui-input-text { 
    height : 25px; 
}​ 

Demostración: http://jsfiddle.net/mEs8U/

+0

Ok, gracias :) – Axiol

1

También puede usar max-height para establecer los límites de autocrecimiento en textarea.

textarea.ui-input-text { 
    max-height : 100px; 
}