iFrame in jQuery UI dialog causes horizontal scrollbar on parent

前端 未结 4 1182
囚心锁ツ
囚心锁ツ 2021-02-06 19:34

I\'m using the jQuery UI dialog to present content in a new iFrame. Everything works out great except that the parent window of the dialog is getting a horizontal scrollbar whi

4条回答
  •  醉酒成梦
    2021-02-06 20:03

    I had the same problem. In my case the dialog is a child of body and I used the following script to prevent overflow:

    $("#your-dialog").dialog({
      //our options,
      open: function(){
        $("body").css("overflow", "hidden");
      },
      close: function(){
        $("body").css("overflow", "initial");
      }
    });
    

提交回复
热议问题