0

我使用 jquery 创建模式弹出窗口。我通过按钮单击事件和相应的代码在这里触发模式弹出窗口

 $(document).ready(function () {
            $("#Button1").click(function () {
                el = document.getElementById("overlayDiv");
                el.style.visibility = "visible";
                el1 = document.getElementById("progress");
                el1.style.visibility = "visible";
                el2 = document.getElementById("image");
                el2.style.visibility = "hidden";
            });
        });

这在我第一次单击按钮时有效,之后它不起作用。

谢谢,哈里。

4

2 回答 2

2

visibility and display (used by .hide()) are different. Instead of visibility: hidden, in your CSS use display: none, then you can use jQuery's show()/hide() functionality like this:

$("#Button1").click(function () {
   $("#overlayDiv, #progress").show();
   $("#image").hide();
});​

It sounds like you're using .hide() to hide the modal, if that's the case, this will fix the issue. Also, a bit less code :)

于 2010-03-27T11:14:07.403 回答
0

尝试这个

 $find(Your popup ID).show();
于 2013-11-22T06:05:25.790 回答