javascript - How to change Twitter follow button width? -



javascript - How to change Twitter follow button width? -

i know has been asked in other threads answers didn't suit case. if embed twitter follow button here:

https://twitter.com/about/resources/buttons

<a href="https://twitter.com/share" class="twitter-share-button">tweet</a> <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>

the js replaces link iframe:

<iframe scrolling="no" frameborder="0" allowtransparency="true" src="http://platform.twitter.com/widgets/tweet_button.1360366574.html#_=1360791644346&amp;count=horizontal&amp;id=twitter-widget-0&amp;lang=en&amp;original_referer=http%3a%2f%2fwww.foo.com%2fsearch%2fcats&amp;size=m&amp;text=search%20results%20for%20%22cats%22%20on%20foo&amp;url=http%3a%2f%2fwww.foo.com%2fsearch%2fcats" class="twitter-share-button twitter-count-horizontal" style="width: 109px; height: 20px;" title="twitter tweet button" data-twttr-rendered="true"></iframe>

as can see width set inline style. know can overide like:

.twitter-share-button { width: 80px !important; }

for illustration don't want because if share count increases big number on particular content page. share count obscured minimum width.

is there way tell twitter size returning iframe according share count inside, no bigger minimum required width needs be?

i know facebook accepts desired width via info attributes data-width believe , can set auto type of behavior asking above. twitter offer similar share button?

fiddle

instead of width, set min-width:

.twitter-share-button { min-width: 80px !important; width: auto !important;}

javascript html css twitter

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -