Twitter iframe小部件如何去除滚动条

3

一直在尝试找出如何删除iframe twitter小部件中的滚动条。我知道无法通过css实现,所以我的下一个尝试是使用jquery。我尝试了以下方法,但似乎没有起作用:

$("iframe").ready(function () {
    $(".stream", this).css("overflow-x", "hidden");
});
2个回答

0

简单解决方案

在 iframe 标签中将 scrolling 属性设置为 no,就像这样:

scrolling="no"

完整的iframe示例:
<iframe scrolling="no" title="Twitter Tweet Button" style="border:0;overflow:hidden;" src="https://platform.twitter.com/widgets/tweet_button.html"  height="28px" width="76px"></iframe>

0

你可以使用 CSS 来禁用它。我使用了这个插件(https://github.com/kevinburke/customize-twitter-1.1)来覆盖 Twitter 的 CSS,然后只需添加:

.timeline .stream {overflow:hidden;}

我也通过将相同的CSS直接添加到本地存储的Twitter widget.js副本中(大约在第30行左右)来隐藏滚动条。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接