2012-09-14 54 views
0

在某些页面上,twitter共享按钮未显示其完整宽度。我跟踪了这​​个问题,它显示的iframe只设置为24px宽度,但我需要将其设置为正确的宽度。问题是..我要的iframe没有直接访问,因为这是将其插入代码:通过javascript/html访问twitter共享iframe

<div style="margin:4px 0 0 5px; float:left; position: relative;"><a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a></div> 
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> 
</div><!-- END #socialNetworking --> 
<script> 

有谁知道我可以编辑的iframe?生成的HTML不显示的iframe,但是挖掘到在Chrome Web开发工具中的HTML检查,我可以在那里看到它:

<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.1347008535.html#_=1347624904492&amp;count=none&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=http%3A%2F%2Fwww.dgfdg.co.uk%2F&amp;size=m&amp;text=Web%20Design%20Kendal%20%7C%20Website%20Design%20Cumbria%20%7C%20Graphic%20Design%20%7C%20Marketing%20%7C%20Advertising%20%7C%20Designworks%20%7C&amp;url=http%3A%2F%2Fwww.fdfdg.co.uk%2F" class="twitter-share-button twitter-count-none" style="width: 24px; height: 20px; " title="Twitter Tweet Button" data-twttr-rendered="true"></iframe> 
+0

如何在创建元素时记住元素? – Qnan

+0

对不起,这是什么意思? js – zomboble

回答

2

https://dev.twitter.com/docs/tweet-button,我认为这是“大小”属性你正在寻找对于。但它只接受分类值。我不认为你可以将它设置为任意大小。

+0

相当新,我跟着链接https://dev.twitter.com/docs/tweet-button和页面底部是一个iframe,这解决了它。但我会标记为正确的链接,帮助;)谢谢你:) – zomboble