function addMessage(time, cls, text) {
    
    //if (ticker[0].hasChildNodes())
    //    $("<hr>").appendTo(ticker)

    var m = $("<span class=\"message\"></span>");
    $("<span class=\"time\">[" + time + "]</span>").appendTo(m);
    $("<span class=\"bar " + cls + "\"></span>").appendTo(m);
    $("<span class=\"content\">" + text + "</span>").appendTo(m);
    m.appendTo(ticker);

    // Remove everything off the screen
    for (var i = 0; i < ticker.children().length; i++) {
        var f = $(ticker.children()[i]);
        var v = ticker.position().top + f.height();
        if (v <= 0) {
            f.remove();
        }
        else {
            break;
        }
    }
}
// Add a new message to the ticker
Add a new message to the ticker
Add a new message to the ticker
function addMessage(time, cls, text) {
    var m = $("<span class=\"message\"></span>");
    $("<span class=\"time\">[" + time + "]</span>").appendTo(m);
    $("<span class=\"bar " + cls + "\"></span>").appendTo(m);
    $("<span class=\"content\">" + text + "</span>").appendTo(m);
    m.appendTo(ticker);
    for (var i = 0; i < ticker.children().length; i++) {
        var f = $(ticker.children()[i]);
        var v = ticker.position().top + f.height();
        if (v <= 0) {
            f.remove();
        }
        else {
            break;
        }
    }
}
function addMessage ( time , cls , text ) { var m = $ ( "<span class=\"message\"></span>" ) ; $ ( "<span class=\"time\">[" + time + "]</span>" ) . appendTo ( m ) ; $ ( "<span class=\"bar " + cls + "\"></span>" ) . appendTo ( m ) ; $ ( "<span class=\"content\">" + text + "</span>" ) . appendTo ( m ) ; m . appendTo ( ticker ) ; for ( var i = 0 ; i < ticker . children ( ) . length ; i ++ ) { var f = $ ( ticker . children ( ) [ i ] ) ; var v = ticker . position ( ) . top + f . height ( ) ; if ( v <= 0 ) { f . remove ( ) ; } else { break ; } } }
Add a new message to the ticker
Add a new message to the ticker
//if (ticker[0].hasChildNodes()) //    $("<hr>").appendTo(ticker) // Remove everything off the screen