我正在处理一个包含共享按钮的页面,单击该按钮会弹出一个 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/