【发布时间】:2012-11-01 19:45:28
【问题描述】:
我目前调用一个脚本来动态地将内容添加到我的弹出框,但是当用户再次单击以关闭它时,我不需要进行此调用。是否可以获取状态并在可见时关闭它?
这是我目前所拥有的:
$('.knownissue').on('click', function() {
var info = $(this).attr('id').substr(5).split(':');
var el = $(this);
// How do I check to see if the popover is visible
// so I can simply close it and exit?
$.post('functions/get_known_issues.php?tcid='+info[0]+'&tcdate=' + info[1], function(data) {
if (data.st) {
el.attr('data-content', data.issue);
el.popover('toggle');
}
}, "json");
});
【问题讨论】:
-
看how the plugin checks it (github)你可能会找到线索
标签: javascript jquery twitter-bootstrap