加载alertbox后,Bootstrap Bootbox删除浏览器滚动条

Ane*_*ran 3 jquery css3 twitter-bootstrap bootbox

我正在使用bootbox警报.它工作正常但加载警报后我的浏览器的滚动条变得消失,我无法滚动我的页面

bootbox.dialog({
      closeButton:false,
      message: "Do you clear all contents?",
      title: "Are you sure to clear all contents?",
      buttons: {

        main: {
          label: "Cancel",
          className: "btn-primary btn-small",
          callback: function(result) {

          }
        },
        danger: {
          label: "Clear!",
          className: "btn-danger btn-small",
          callback: function(result) {
            // clear contents from here
            content_id.find(".canvas_frame").html("");

            $(".sidebar").find(".tbProperties").hide();
            showtbBoxpanel(); // $(".sidebar").find(".tbBoxpanel").show();

          }
        }

      }
    });
Run Code Online (Sandbox Code Playgroud)

小智 6

尝试将此添加到您的CSS:

<style>
.modal{
    direction:rtl;
    overflow-y: auto;
}

.modal .modal-dialog{
    direction:ltr;
}

.modal-open{
    overflow:auto;
}
</style>
Run Code Online (Sandbox Code Playgroud)

  • 不确定为什么使用``direction``.它使我的滚动条移动到页面的左侧.只需将它从``.modal``中删除并完全删除``.modal .modal-dialog``就可以为我带来魅力. (2认同)