Jig*_*tel 4 javascript jquery popup twitter-bootstrap bootstrap-modal
我是 Bootstrap 的新手。
面临的问题:
当我关闭嵌套的(第二个)模态弹出窗口时,两个弹出窗口都会同时关闭。因为我使用“data-dismiss='modal'”来关闭模态。有没有其他方法可以关闭嵌套模态弹出窗口。
啊现在我明白了!您需要使用 javascript 关闭模态,然后 :) 我在这里编写了一个小函数。只需将“closeModal”类添加到要为其关闭模态的按钮。
基本上它会找到按钮所属的父模态并关闭该模态。希望这会有所帮助,如果需要,您可以更改它。
$(".closeModal").click(function(){
$(this).closest(".modal").modal("hide")
});
Run Code Online (Sandbox Code Playgroud)
http://jsfiddle.net/kjazcz5e/4/
Bootstrap 提供了一个 .modal() JQuery 插件来让你控制模态。看一看:http : //getbootstrap.com/javascript/#modals