【发布时间】:2016-01-21 06:45:06
【问题描述】:
当我点击一个锚点时,我正在显示一个弹出框。但是弹出框不会在第一次点击时触发,它如何在第二次点击时起作用。
HTML:
<!-- Pop Check -->
<div class="popover-markup">
<input class="checkbox-inline" type="checkbox" value="Option1">
<a href="javascript:void(0)" class="trigger" data-placement="bottom" tooltip="Manage Users">Option1</a>
<!-- Popup Content-->
<div class="content hide">
<div class="head hide">Select Users For Option1<span class="close_popover"><i class="fa fa-times"></i></span></div>
<div>
<label class="checkbox-inline">
<input type="checkbox" id="" class="si_DSCM" value="user6"> User 6
</label>
</div>
</div>
</div>
JS:
$(document).on('click', ".popover-markup>.trigger", function () {
$(this).popover({
html: true,
title: function () {
return $(this).parent().find('.head').html();
},
content: function () {
return $(this).parent().find('.content').html();
}
});
});
这是我的小提琴:https://jsfiddle.net/47pef6g8/
我发现了类似的问题,但对我的情况没有帮助。
请帮忙。提前致谢。
【问题讨论】:
-
添加你的代码 jsfiddle
标签: javascript jquery html twitter-bootstrap