jQuery dialog popup

后端 未结 6 1850
孤街浪徒
孤街浪徒 2020-12-14 07:34

I am trying to get this dialog popup form to show up when this link is clicked but it does not work for me. I\'ve been working on this for the past three hours and this is g

6条回答
  •  攒了一身酷
    2020-12-14 08:13

    You can use the following script. It worked for me

    The modal itself consists of a main modal container, a header, a body, and a footer. The footer contains the actions, which in this case is the OK button, the header holds the title and the close button, and the body contains the modal content.

     $(function () {
            modalPosition();
            $(window).resize(function () {
                modalPosition();
            });
            $('.openModal').click(function (e) {
                $('.modal, .modal-backdrop').fadeIn('fast');
                e.preventDefault();
            });
            $('.close-modal').click(function (e) {
                $('.modal, .modal-backdrop').fadeOut('fast');
            });
        });
        function modalPosition() {
            var width = $('.modal').width();
            var pageWidth = $(window).width();
            var x = (pageWidth / 2) - (width / 2);
            $('.modal').css({ left: x + "px" });
        }
    

    Refer:- Modal popup using jquery in asp.net

提交回复
热议问题