javascript - Bootstrap 弹出链接不起作用

标签 javascript html twitter-bootstrap

我正在处理一个包含共享按钮的页面,单击该按钮会弹出一个 Twitter Bootstrap 弹出窗口,其中是共享链接。

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
  });

它几乎做到了这一点。东西弹出,链接在那里并且是蓝色的,将鼠标悬停在它们上面会将光标变成一只小手,但是当我点击时,没有任何反应!我可以右键单击以在新选项卡中打开,链接再次起作用。

为什么会这样?

最佳答案

更新:

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'
  });

});

关于javascript - Bootstrap 弹出链接不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14865475/

相关文章:

angular - Bootstrap 的 js 元素即使已导入也无法正常工作

javascript - 多个音频,当前正在使用 javascript 播放时自动停止其他音频

javascript - 如何自动将 TypeScript 转译为 JavaScript?

javascript - 从js中获取输入值

html - 让 Affix 为导航和导航栏工作

html - 垂直对齐 Bootstrap 3 中的整行

javascript - 应用函数时应用类或函数

javascript - jquery $.post 除非调试否则不起作用

javascript - <img src ="x"onerror ="alert(\"hello\")"/>) 转义引号是非法的?

php - 尝试循环遍历 html 下拉菜单