javascript - Bootstrap Popover will Only Load Once. Why? -
i have boostrap popover show once , not work. missing?
here js fiddle
the problem due $().load();, it's asynchronized , when return $("#pop-content").load(...); first time return contents of #pop-content div, , thereafter contents of #pop-content set result of url you've mentioned in jquery load, in case it's blank.
i've replaced $(#pop-content).load(...); $(#pop-content).html(); , results expected.
see fiddle
edit
$(document).ready(function () { $('.pop-form').popover({ html: true, title: function () { return $("#pop-head").html(); }, content: function () { var result = ''; $.ajax({ url: "your url", async: false, success:function(response){ result = response; } }); return result; } }); // make popup larger var p = $('.popbutton').popover(); p.on("show.bs.popover", function (e) { p.data()["bs.popover"].$tip.css("max-width", "630px"); }); }); try above code, should work well.
Comments
Post a Comment