Masonry 不适用于 Twitter 小部件
我有一些 JavaScript 可以从用户那里提取最近的推文。它看起来像这样:
getTwitters('tweet', { id: 'LadyGaga', count: 8, enableLinks: true, ignoreReplies:
false, clearContents: true, template: '%text% <a class="arrow"
href="http://twitter.com/%user_screen_name%/statuses/%id_str%/" target="_blank"></a>'
});
推文作为列表动态加载到
<div id=tweet"></div>
with
$(window).load(function () { $('#tweet').masonry(); });
中,但由于某种原因它不起作用:(我一直这样做,我不知道为什么会这样做。
我的 CSS 也很安全:
#tweet {
margin-left:-43px;
}
#tweet li {
list-style:none;
padding:5px;
margin:0 0 3px 3px;
background:url('http://static.tumblr.com/ux4v5bf/wM2lywrxr/aeeatagsd.png') repeat;
float:left;
width:88px;
}
I have some Javascript that pulls recent tweets from a user. It looks like this:
getTwitters('tweet', { id: 'LadyGaga', count: 8, enableLinks: true, ignoreReplies:
false, clearContents: true, template: '%text% <a class="arrow"
href="http://twitter.com/%user_screen_name%/statuses/%id_str%/" target="_blank"></a>'
});
The tweets are loaded as lists dynamically into
<div id=tweet"></div>
with
$(window).load(function () { $('#tweet').masonry(); });
however for some reason it is not working :( I have done it this way for ever and I have no clue why it would do this.
My CSS is safe as well:
#tweet {
margin-left:-43px;
}
#tweet li {
list-style:none;
padding:5px;
margin:0 0 3px 3px;
background:url('http://static.tumblr.com/ux4v5bf/wM2lywrxr/aeeatagsd.png') repeat;
float:left;
width:88px;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我再次查看了我的代码,发现我必须针对 tweet 的 ul 而不是 tweet 本身。哈哈我傻了。
I took a look at my code again and figured I had to target ul of tweet rather than tweet itself. Haha silly me.