I'm looking to create a popover which has multiple pages to it (different content materials) that update when clicking on the popover. The idea is that you toggle the popover and "page1" content loads, clicking on it will load "page2" content.
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();
});
How can I do something along the lines of this:
$("#page1").click(function() {
$btn.popover.options.content = 'Page 2';
});
while incorporating the functionality of closing the popover whenever anything else is clicked, such as in this answer?