为什么模态不会出现在中心?

时间:2017-04-16 04:06:06

标签: javascript html angularjs semantic-ui

我使用带有角度的语义模态,并且我获得了位置问题。问题是,当我弹出模态时,它并没有显示在正确的位置。

enter image description here

这是我的 html文件

<div class="ui modal">
      <div class="header">Header</div>
      sdasdasdasds
</div>

这是在 controller.js文件

$scope.agregar = function(){

    //$('.ui.modal').modal();
    $('.ui.modal').modal({blurring: true}).modal('show').modal("refresh");
}

1 个答案:

答案 0 :(得分:0)

很抱歉迟到的回复,但是当我在寻找同样问题的解决方案时,您的帖子是搜索结果。

有些portals说超时100毫秒有效,但对我没有帮助。

我找到了解决这个问题的方法。不是一个非常好的方法,但刷新两次解决了我的问题。

我正在处理角度加语义组合,您可以看到以下代码段:

$scope.reviewAppointment = function(appointment) {
    var modal = $('.ui.modal');

    modal.modal('show');
    modal.modal('refresh');
    modal.modal('refresh');

    //rest of the code
}

以下是未完成刷新的时间

enter image description here

刷新一次

比以前的情况更好,但你仍然可以在模态上方看到一些额外的空间,底部没有留下任何空间。

enter image description here

刷新两次

模态完美地放在中心。如果你现在应用更多次刷新,它就不会改变。

enter image description here

希望它有所帮助。但同样不是一个很好的方法。

相关问题