开发者

JQuery Click Event Problem

开发者 https://www.devze.com 2022-12-24 03:18 出处:网络
Im creating modal popup using jquery. Im firing the modal pop up through button click event and the co开发者_如何学Gorresponding code here

Im creating modal popup using jquery. Im firing the modal pop up through button click event and the co开发者_如何学Gorresponding code here

 $(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";
            });
        });

This works when I click the button at first, after that it doesnt works.

Thanks, Hari.


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 :)


Try this

 $find(Your popup ID).show();
0

精彩评论

暂无评论...
验证码 换一张
取 消