Opening another popup from jqModal

I am creating a popup using jqModal and I have one main popup. After clicking OK, I have to close this window and open another popup. How do you achieve this?

Here my problem is that the click event is not working. While I am pressing the {#b} button more than this when the button is pressed, I need to open another popup.

My code

<html>
    <head>
        <script src="jquery-latest.js" type="text/javascript"></script>
        <script src="jqModal.js" type="text/javascript"></script>
        <script type="text/javascript">
            $().ready(function() {
                $('#ex3a').jqm(
                { trigger: '#ex3aTrigger',
                  overlay: 30,
                  overlayClass: 'Overlay'}) .jqDrag('.jqDrag');

            $('input.jqmdX') .hover( function(){ $(this).addClass('jqmdXFocus'); },
            function(){ $(this).removeClass('jqmdXFocus'); })
                .focus( function(){ this.hideFocus=true;
                    $(this).addClass('jqmdXFocus'); })
                .blur( function(){ $(this).removeClass('jqmdXFocus'); });
            $("#b").click(function () {
                alert("hello"); });
            });
        </script>
    </head>
    <body>
        <a href="#" id="ex3aTrigger">
           view</a> dialog
        <div id="ex3a" class="jqmDialog">
            <div class="jqmdTL">
                <div class="jqmdTR">
                    <div class="jqmdTC jqDrag">[Dialog Title] </div>
                </div>
            </div>
            <div class="jqmdBL">
                <div class="jqmdBR">
                    <div class="jqmdBC">
                        <div class="jqmdMSG"> Welcome Page <br/> <br/>
                            <div id="b"> <button> OK </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>

      

0


source to share


2 answers


Try setting $("#b").click

in jqModal onShow callback.



+1


source


Whenever possible, I came to this question, and the question was posted a long time ago, 7 years ago. Now we have a lot of plugins and bootstrap, it gets much easier.



http://getbootstrap.com/javascript/#modals

0


source







All Articles