martes, 29 de octubre de 2013

Jquery ui - Cambiar propiedades CSS de un textarea - button



Bienvenid@s hoy os mostraré como crear un textarea a través del elemento button de Jquery UI y como modificar los estilos CSS a través de ui-button para obtener un textarea personalizado.

Ejemplo ...



<!-- By http://jquery-manual.blogspot.com -->
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script>
$(function() {
$( "#textarea" ).button();
});
</script>

<style>
#textarea.ui-button
{
padding: 10px;
background: #FFFFFF;
text-align: left;
color: grey;
font-size: 14px;
border: 1px solid grey;
cursor: text;
}

#textarea.ui-button:focus
{
border: 1px solid yellow;
}
</style>
</head>
<body>
<textarea id="textarea" placeHolder="Introduce el mensaje" cols="35" rows="7"></textarea>
</body>
</html>




No hay comentarios: