开发者

Why Jquery dialogUI allowing to do other work on back end while popup message?

 $("#window").dialog({
          resizable: true,
          height: 180,
          title: titles,
          width: 500,
          modal: false,
          buttons: {
              "OK": function () {
                  $(this)开发者_运维知识库.dialog("close");
                  if (redirectURL) {
                      window.location = redirectURL;
                  }
              }
          }
      });

I can see my dialog box.but I can able to do other work on back side when Dialogu is appears?

is this Jquery dialog doesnot work like alert?

what is the differnce between alert and jquery Dialog Ui?

alert does not allow us to do anything until if you close alert box. is there any way we can do same for jquery dialog?

Thanks


You just need to set the following in your declaration:

modal : true

Modal pop-ups are much like alerts in the fact that you cannot perform any outside options while the pop-up is present.

For your implementation:

$("#window").dialog({
          resizable: true,
          height: 180,
          title: titles,
          width: 500,
          modal: true,
          buttons: {
              "OK": function () {
                  $(this).dialog("close");
                  if (redirectURL) {
                      window.location = redirectURL;
                  }
              }
          }
      });

If the overlay isn't working - perhaps through some lack of reference for the necessary jQueryUI CSS files, you could add something similar to the following to test it:

In your CSS (if you are unable to find this CSS class - it is probably due to a file not being included. If you include it, that should fix your problem)

.ui-widget-overlay {
    background: black;
    opacity: 0.5;
    filter: alpha(opacity = 50);
    position: absolute;
    top: 0;
    left: 0;
 }

Then in your dialog declaration, add the following:

open: function(){
            $('.ui-widget-overlay').show();
        }

I haven't worked with jQueryUI much, but hopefully something like this might help you out.


try setting modal:true this should work as you want it to.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜