admin管理员组

文章数量:1336085

I am new on Bootstrap.

  • My Requirement is to open Modal Popup in a page. (Done).
  • Open Modal Popup required to open another Modal Popup. (Done).

Facing Issue :

When I goes to close the nested (Second) Modal Popup, both popup is closed at a time. Because I Use "data-dismiss='modal'" to close the modals. is there any other way to close Nested Modal Popup.

I am new on Bootstrap.

  • My Requirement is to open Modal Popup in a page. (Done).
  • Open Modal Popup required to open another Modal Popup. (Done).

Facing Issue :

When I goes to close the nested (Second) Modal Popup, both popup is closed at a time. Because I Use "data-dismiss='modal'" to close the modals. is there any other way to close Nested Modal Popup.

Share edited May 28, 2015 at 14:10 amphetamachine 30.7k12 gold badges67 silver badges74 bronze badges asked Nov 11, 2014 at 9:33 Jignesh PatelJignesh Patel 4475 silver badges16 bronze badges 1
  • Did the modals have different id's? Can you please add your nested modals code? – Jordi Castilla Commented Nov 11, 2014 at 9:37
Add a ment  | 

1 Answer 1

Reset to default 6

Ah now I understand! You'll need to close your modal using javascript then :) I've written a little function here. Just add the "closeModal" class to the button which you want to close the modal for.

Basically it finds the parent modal that the button belongs to and closes that modal. Hopefully this helps and you can change it around if needs be.

    $(".closeModal").click(function(){
        $(this).closest(".modal").modal("hide")
    });

http://jsfiddle/kjazcz5e/4/

Bootstrap provides a .modal() JQuery plugin to let you control modals. Take a look: http://getbootstrap./javascript/#modals

本文标签: javascriptBootstrap modaljs v320 Nested modal popupStack Overflow