I need to close 2 modals in the same time. Why?

I have 2 modals, first shows the information and the second shows a exclude confirmation. When i close the second i want to close all modals.

This is in ASP.NET MVC and RAZOR.

This JS dont work, can you help me? Thanks!!

    $(function () {

        $(".close-modal-edit").click(function () {
            $('.modal').modal('hide');
        });

    });
        <!-- FIRST MODAL -->        
        <div class="portfolio-modal modal fade" id="dialog" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-content">
                <div class="close-modal" data-dismiss="modal">
                </div>
                <div class="container">
                    <div class="row">
                        <div class="col-lg-8 col-lg-offset-2">
                            <div class="modal-body text-left">
                                <a class="btn btn-success pull-right" data-dismiss="modal"> Close </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- CONFIRMATION MODAL -->
        <div class="portfolio-modal modal fade" id="dialog-exclude" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-content modal-content-edit">
                <div class="close-modal close-modal-edit" data-dismiss="modal">
                </div>
                <div class="container">
                    <div class="row">
                        <div class="col-lg-4 col-lg-offset-4">
                            <div class="modal-body text-left">
                                <a class="btn btn-success pull-right close-modal-edit" data-dismiss="modal"><i class="fa fa-times"></i> Cancel </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>	

Related posts

Recent Viewed