venkatachalam
venkatachalam

Reputation: 102439

Opening another popup window from jqModal

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

Here my problem is that the click event is not working. While I am pressing a button {#b}, more than this onclick of the button I have to open another popup window.

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>

Upvotes: 0

Views: 1914

Answers (2)

Anto S
Anto S

Reputation: 2449

By Chance I came to this question and the question posted very long ago, 7 years back. Now we have lot of plugins and bootstrap designs, this become very easier.

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

Upvotes: 0

Mauricio Scheffer
Mauricio Scheffer

Reputation: 99740

Try setting $("#b").click in the onShow callback of jqModal.

Upvotes: 1

Related Questions