次のコードを持つprogress.jsファイルがあります
$('#text_area_input').keyup(function()
{
var text_area_box =$(this).val();//Get the values in the textarea
var max_numb_of_words = 160;//Set the Maximum Number of characters
var main = text_area_box.length*100;//Multiply the lenght on words x 100
var value= (main / max_numb_of_words);//Divide it by the Max numb of words previously declared
var count= max_numb_of_words - text_area_box.length;//Get Count of remaining characters
if(text_area_box.length <= max_numb_of_words)
{
$('#progressbar').css('background-color','#5fbbde');//Set the background of the progressbar to blue
$('#count').html(count);//Output the count variable previously calculated into the div with id= count
$('#progressbar').animate(//Increase the width of the css property 'width'
{
'width': value+'%'
}, 1);//Increase the
}
else
{
$('#progressbar').css('background-color','yellow');
//If More words is typed into the textarea than the specified limit ,
//Change the progress bar from blue to yellow
var remove_excess_characters =text_area_box.substr(0,max_numb_of_words);
$('#text_area_input').val(remove_excess_characters);
//Remove the excess words using substring
}
return false;
});
});
phpファイルでその関数を呼び出す必要があります。どうすればそれを正しくすることができますか?そして私は私のプロジェクトに必要なすべてのCSSを含めます