2014-11-24 96 views
0

採取正常的跟蹤按鈕,用戶名來自https://about.twitter.com/resources/buttons#followTwitter遵循按鈕不會顯示用戶名時,在下拉

把它正常引導下拉列表裏面像這樣http://jsfiddle.net/dJDHd/417/,它會使沒有用戶名。

   <div class="btn-group"> 
       <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> 
        <span data-bind="label">Dropdown</span>&nbsp;<span class="caret"></span> 
       </button> 
       <ul class="dropdown-menu" role="menu"> 
        <li><a href="#">Item 1</a></li> 
        <li><a href="#">Another item</a></li> 
        <li> 
         <a href="https://twitter.com/wikibudgets" class="twitter-follow-button" data-show-count="false">Follow @wikibudgets</a> 
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> 
        </li> 
       </ul> 
       </div> 

<br> 
<br> 


<a href="https://twitter.com/wikibudgets" class="twitter-follow-button" data-show-count="false">Follow @wikibudgets</a> 
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> 

下拉菜單下方顯示的是相同的按鈕,表明它在下拉菜單之外正常工作。

編輯 我在OSX上使用最新的Chrome(38.0)。這個問題沒有在最新的Firefox上顯示。

+1

你使用什麼瀏覽器?在firefox 33上,下拉菜單中的按鈕與下面的按鈕相同(在你的小提琴中)。 – artm 2014-11-24 11:59:03

+0

我編輯了這個問題來提供更多的細節,謝謝指出。 – 2014-11-24 12:46:55

+0

如果答案不明顯,我會嘗試檢查firefox開發人員工具中的html,並檢查應用的css規則等,並在chrome上做同樣的事情,看看html/css是不同的,沒有應用,沒有影響或缺失,等等。然後,問題變成「爲什麼chrome忽略填充規則」,例如,爲了讓你更接近。 – artm 2014-11-24 12:57:54

回答

0

我在某處找到了答案,如果在不可見的情況下繪製該按鈕,該按鈕將無法正確呈現。我必須更改我的代碼,以便在用戶打開下拉菜單後才能繪製該按鈕。