2012-03-01 59 views
0

我已经创建了一个实时微博饲料到我的网站上,这是一个想要包裹在旋转木马上。我面临的挑战是将twitter API feed div转换为“li's”,这样每个twitter feed都会以独立的li显示。微件装饰问题

click here

我一直在这样做读成以下;

http://api.jquery.com/wrap/

但我发现很难消化。在这个论坛中有没有人可以分解开发过程来实现这一目标?

感谢

+0

你使用搜索api来检索这些推文吗? – martincarlin87 2012-03-01 12:50:01

+0

我使用这个https://twitter.com/about/resources/widgets/widget_profile – 2012-03-01 12:52:16

+0

嗯,我做了一个滚动的twitter部件,使用搜索api获取推文,我想有一个插件,正在尝试做,因为我记得找到它,但因为它没有使用搜索API,我无法使用/将其转换为我所需要的。我现在要看看它 – martincarlin87 2012-03-01 12:56:06

回答

0

我帮助了你的其他问题,以便即时通讯假设你想这适用于同一网址 - http://thisiswired.com/test/test.html

如果这是你可以使用下面的代码的情况下:

// Remove unwanted div 
$('.twtr-reference-tweet').remove(); 

// Change the <div>s to <li>s 
$('.twtr-tweet').each(function() { 
    $(this).replaceWith('<li id="'+$(this).attr('id')+'" class="'+$(this).attr('class')+'">' + $(this).html() + '</li>'); 
}); 

// Change the parent <div> to <ul> and wrap it in a <div> ready to apply the carousel 
$('.twtr-tweets').replaceWith('<div id="carouselId"> <ul class="twtr-tweets">'+$('.twtr-tweets').html()+'</ul></div>'); 

排序!