angularjs – 如何设置角度模态自定义高度和宽度

前端之家收集整理的这篇文章主要介绍了angularjs – 如何设置角度模态自定义高度和宽度前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我找到了一种方法来改变角度模态的宽度,但我怎么也想不出如何设置我想要的高度.我需要模态宽度为400px,高度为400px.我还需要重新定位它,使它位于屏幕的中心.谢谢
plunkr

$scope.NewJobModal = function () {

      var modalInstance = $modal.open({
          templateUrl: 'views/modals/NewJobModal.html',controller: 'NewJobModalInstanceCtrl',windowClass: 'large-Modal',resolve: {
              p: function () {
                  return $scope.p;
              }
          }
      });
  };

.large-Modal .modal-dialog{
width:30%;
}

解决方法

两件事情:

1 – 在你提供的Plunkr中你没有附上.css文件.将src更改为href.

2 – 然后在你的css文件中:

.large-Modal .modal-dialog{
  height: 400px;
  width:400px; 
  margin: auto;
  position: absolute;
  top:0;
  right: 0;
  bottom: 0;
  left: 0;
}

猜你在找的Angularjs相关文章