我有一个函数,如果满足某些条件[通过来自3个不同字段(两个<input>
元素和一个<selection>
元素)的输入将创建并显示弹出窗口元素。我目前只显示在所有3场中都有价值,所以我可以测试酥料饼的显示/隐藏功能酥料饼,选择元件是联系在一起的酥料饼...每次创建弹出窗口时都不会运行Bootstrap弹出窗口单击事件代码
<select data-toggle="popover" data-trigger="manual" class="invalid-model-popover select-group aircraft-model" style="width: 90%;">
<option value="default" selected>Select a model...</option>
</select>
这是我用来创建popover的代码。
verifyRoute: function() {
$('#' + this.currentLeg.attr('id') + ' .invalid-model-popover').popover({
placement: 'bottom',
html: true,
content: "<div style='display:inline-block;width:100%'><i class='glyphicon glyphicon-remove pull-right'>" +
"</i></div>" +
"<div style='font-weight:bold'>Note:</div>" +
"<div>Aircraft range does not meet<br>leg requirements." +
"Select<br>alternate aircraft or arrange<br>fuel" +
" stops</div>"
}).click(function(event) {
$('#' + routeVerifier.currentLeg.attr('id') + ' .glyphicon-remove').click(function() {
$('#' + routeVerifier.currentLeg.attr('id') + ' .invalid-model-popover').popover('hide');
});
});
$('#' + this.currentLeg.attr('id') + " .invalid-model-popover").popover('show');
},
所以目前当我从一组动作产生弹出窗口时,“在两个文本输入中输入一些东西,从select元素中选择一个选项,出现弹出窗口,并点击”x“,然后弹出窗口关闭。当我使用序列“从select元素中选择一个选项,在两个文本输入中输入内容”时,弹出窗口出现,但“x”的onClick未设置。如果我逐步通过代码注册事件的代码....
.click(function(event) {
$('#' + routeVerifier.currentLeg.attr('id') + ' .glyphicon-remove').click(function() {
$('#' + routeVerifier.currentLeg.attr('id') + ' .invalid-model-popover').popover('hide');
});
});
甚至没有运行。这里是一个小提琴来说明问题http://jsfiddle.net/restin84/fxf9wneb/68/任何意见将不胜感激。
做它的工作小提琴,让我们知道 – Innodel 2014-10-18 06:12:54
这@Innodel [http://jsfiddle.net/restin84/fxf9wneb/68/。您可以使用上面的相同方案并获得相同的描述结果。文本框触发onBlur事件上的弹出窗口创建,只需单击它们即可。 – restin84 2014-10-19 04:36:56
我觉得在目前的小提琴中,当两个输入和选择标签有东西时,弹出来。但是,现在澄清我究竟是什么,而不是。 – Innodel 2014-10-20 04:10:22