简体   繁体   中英

Jquery UI dialog, only opens once

I realize this has been asked before, but I am unable to get this to work even after reading other answers.

I'm using Jquery UI basic dialog popup to open a pop-up for a set of images.

However, I am only able to open an image once, then the dialog will not open again. Here is my code:

 <script type="text/javascript"> // added .dialog:disaplay:none; to desktop.css
        $(".open").click(function(BasicDialog) {
            var div = $(this).next("div.dialog");
            var dia = $(div).dialog({
                draggable: false,

                width: "300px",
                modal: true,
                title: "",
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");

                    }
                }

            });
            BasicDialog.preventDefault();
        });
</script>

Can anybody give me a hint towards what I am doing wrong here?

Thanks, Mark

autoOpen property. It is what you are looking for. See the documentation: http://api.jqueryui.com/1.9/dialog/#option-autoOpen

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM