答案 0 :(得分:0)
尝试使用此尺寸:
jQuery(function() {
//set up the editor instance for ckeditor
var editor = CKEDITOR.replace('textcounter', {
toolbar: [['Source'], ['Cut', 'Copy', 'PasteText'], ['Undo', 'Redo', '-', 'SelectAll', 'RemoveFormat'], ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'], ['SpecialChar']]
});
//global for editor instance
var global = editor;
//set timed interval to run function
setInterval(function updateCount() {
var almost = $("<div />").html(global.getData()).text();
var count = 140 - almost.length;
if(almost.length <= 140) {
jQuery('#counter').text(count).removeClass("red");
jQuery('.bar').stop().animate({"width": value+'%'}, 1).removeClass("redbar").addClass("bluebar");
} else {
jQuery('#counter').text(count).addClass("red");
jQuery('.bar').stop().animate({"width": '100%'}, 1).removeClass("bluebar").addClass("redbar");
}
}, 500);
});