【发布时间】:2016-09-26 05:34:50
【问题描述】:
我正在寻找一个弹出框,其中包含多个页面(不同的内容材料),当点击弹出框时会更新。这个想法是您切换弹出框和“page1”内容加载,单击它将加载“page2”内容。
var $btn = $("#myButton");
$("html").click(function(){
$btn.popover('hide');
});
$btn.popover({title: "Popover", html: "true", trigger: "manual", placement: "top", content: "<div id='page1'>Page 1</div>"}).click(function(e) {
$btn.popover('toggle');
e.stopPropagation();
});
我怎样才能做到这一点:
$("#page1").click(function() {
$btn.popover.options.content = 'Page 2';
});
同时包含在单击其他任何内容时关闭弹出框的功能,例如在this answer?
【问题讨论】:
标签: javascript jquery html twitter-bootstrap