martes, 29 de octubre de 2013

Jquery ui - Cambiar propiedades CSS de un campo de texto(textbox) - button




Bienvenid@s en esta ocasión os traigo un modo sencillo de crear un campo de texto(textbox) con Jquery UI, para ello crearemos un elemento input text y modificaremos sus propiedades CSS mediante la clase ui-button de Jquery UI.



<!-- 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() {
$( "#textbox" ).button();
});
</script>

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

#textbox.ui-button:focus
{
border: 1px solid yellow;
}
</style>
</head>
<body>
<input type="text" id="textbox" placeHolder="Campo de texto" size="30">
</body>
</html>




No hay comentarios: