tạo 1 trang js. inthetopic
- Code:
$(document).ready(function (g) {
var comment = $('textarea#text_editor_textarea'),
minCommentgLength = 10, //Num. de caracteres mínimos para enviar
$commentgValue = comment.val(),
$commentgLength = $commentgValue.length,
submitgButton = $('form input[type=submit]').hide();
Copyrights = '©Copyright by giObanii. ©toxigeek.com. All Rights Reserved',
$('textarea#text_editor_textarea').after('<span class="tgcounter"></span>').after('<p class="tgcounter">Ghi 10 ký tự đi Ku: <span></span></p>');
counter = $('span.tgcounter');
$('form').find('p.tgcounter > span').html(minCommentgLength);
comment.keyup(function () {
var $this = $(this);
$commentgLength = $this.val().length;
counter.html($commentgLength);
if ($commentgLength > minCommentgLength - 1) {
submitgButton.fadeIn(200);
} else {
submitgButton.fadeOut(200);
}
});
});
- Code:
/*Gioi han ky tu VNA-Giobanni*/
form span.tgcounter {float: right;color: #000;}
form p.tgcounter {font-size: 11px;float: left;color: #000;}
form p.tgcounter> span {color: #000;}