简体   繁体   English

Bootstrap Popover链接不起作用

[英]Bootstrap popover links not working

I am working on a page that involves a share button that, when clicked, pops up a twitter bootstrap popover and inside it are the share links. 我正在处理一个包含共享按钮的页面,单击该按钮会弹出一个Twitter引导程序弹出窗口,并且在其中是共享链接。

var content = '<a href="http://www.facebook.com/share.php?u='+link+'">Post to facebook</a><br>';
  content += '<a href="http://twitter.com/home?status='+link+'">Post to twitter</a><br>';
  $('.sharelist').popover({
      'title': 'Share this Playlist', 
      'placement': 'bottom', 
      'html': true, 
      'content': content
  });

And it does almost that. 它几乎做到了。 The thing pops up, the links are there and blue, hovering over them changes the cursor to a little hand, but when I click, nothing happens! 东西弹出了,链接在那里并且是蓝色,将鼠标悬停在它们上面会将光标移到小手上,但是当我单击时,什么也没发生! I can right click to open in a new tab, and the links work again. 我可以右键单击以在新选项卡中打开,然后链接将再次起作用。

Why is this happening? 为什么会这样呢?

UPDATE: 更新:

ADD A CLASS TO YOUR LINK NAMED "post-popover"  and
$(document).ready(function() {
  $('.post-popover').popover({
    placement: 'bottom',
    title: 'Share this Playlist',
    content: 'content',
    html: true, 
    trigger: 'click'
  });

}); });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM