Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
959 views
in Technique[技术] by (71.8m points)

jquery - How can I list two Linkedin Follow Buttons in a Twitter Bootstrap Dropdown

I have been messing with this for awhile... http://jsfiddle.net/ravenna/GFydL/7/

<div class="dropdown">
  <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown trigger</a>
  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
      <li>Test</li>
      <li>
       <script type="IN/FollowCompany" data-id="621453" data-counter="right"></script>   

      </li>
  </ul>
</div> 

What I have is multiple drop-downs that each represent a user profile. If the user has a Linkedin Profile on file with us then a follow button is visible for their dropdown.

All browsers show the first one, and chrome shows the second one just fine. FF and IE only show a sliver of the icon for the 2nd and any more. any idea how to see any number of linked in Follow buttons?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

First i found the buttons load slow sometimes so you could open the drop-down before your buttons loads.

I couldn't test on IE. I found a solution for firefox. The linkedin api (js) loads a div in a iframe in a iframe in a span in a span (or something like) that. I found the button iframes load but got a width of only 2px. The 2 px width seems to be caused by the display:none of the ul.dropdown-menu. My solution replace the display with visibility so the div got space:

 ul.dropdown-menu
 {
 display: block; visibility: hidden;
 }  

.open > .dropdown-menu
{
visibility: visible;
}   

See: http://jsfiddle.net/bassjobsen/dsasu/1/

Instead of the visibilty you also could load the content elsewhere with space and copy it to the dropdown on first click.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...