我正在使用 Bootstrap 弹出窗口,当单击某个特定按钮时,它会打开并再次单击相同的按钮关闭。
我试图在标题旁边添加一个关闭按钮并且成功了,但是当我点击关闭按钮时没有关闭。
我的代码:
$('#emailPopover').popover({
placement:'right',
trigger: 'click',
html: true,
title:'Voter Variables'+
'<button type="button" id="close" class="close" onclick="$(this).popover("hide");">×</button>'
});
最佳答案
尝试使用 "
而不是这样的引号:
$('#emailPopover').popover({
placement:'right',
trigger: 'click',
html: true,
title:'Voter Variables'+
'<button type="button" id="close" class="close" onclick="$("#emailPopover").popover("hide");">×</button>'
});
bootply 示例:http://www.bootply.com/pd2qZayqju
关于javascript - Bootstrap 弹出窗口未关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27503807/