开发者

jQuery-UI widget/control to do Twitter UI like updates?

I have the need to find a jQuery-UI widget/control to do Twitter UI-like updates. What I mean by this is when a Twit comes in, it replaces the one at the op开发者_如何学编程 of the list, pushing others downward in the browser UI. Does anyone know of such a widget or failing that, how to do it in Javascript?

Thanks


It's simple in jquery...

HTML

<div id="tweets">
    <div>Tweet 1</div>
    <div>Tweet 2</div>
</div>

javascript

$(function() {
  //Get new tweet however
    var newtweet = "New Tweet"

    $("<div>"+newtweet+"</div>").prependTo("#tweets").hide().slideDown(200);
});


Exact functionality is really up to you. There's little reason to use any kind of plug-in, as it is really trivial javascript to do the basics setup.

function addItem(title, text)
{
    var pHTML = ['<div class="container">',
                    '<div class="title">',
                        title,
                    '</div><div class="description">',
                        text,
                    '</div></div>'].join('');
    // You'd do any animates here. 
    //  You could also drop the bottom item in the list here, if so desired.
    $('#box-wrapper').prepend(pHTML); 
}


Here are a couple of suggestions to add to the mix, if you don't feel like writing any js:

http://thomasbillenstein.com/jTweetsAnywhere/demo/

http://tweet.seaofclouds.com/

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜