Programación, Seo, Usabilidad y Marketing Online
Contador al estilo Twitter con Jquery
Como realizar tu contador de caracteres al estilo Twitter, para implementarlo, utilice JQuery un framework de Javascript, muy conocido, el plugin Jquery Limit y CSS para realizar el estilo que tiene este contador en Twitter.
Como todo plugin jQuery debemos cargar los ficheros Javascript necesarios.
HTML:
la implementación con el plugin: Jquery Limit, es súper sencilla, solo basta incluir el siguiente código dentro del body de la pagina:
PHP:
-
<script type="text/javascript">
-
$(document).ready( function() {
-
$('#myTextarea').limit('140','#charsLeft');
-
});
-
</script>
Donde 140 es el numero de caracteres máximo, #charsLeft es el tag html donde irá el contador de caracteres y #myTextarea es el nombre del textarea donde se aplicara el conteo.
| Print article | This entry was posted by miguelsumaran on March 17, 2010 at 12:18 am, and is filed under Programación. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |