0

以下のリンクから Jquery と CSS を自分の Web サイトに配置しました。

http://jsfiddle.net/VagrantRadio/2Jzpr/

しかし、文字カウントダウンが表示されません。私は何を間違っていますか?

4

1 に答える 1

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);
});
于 2012-05-19T08:22:53.923 に答える