需要在模式区域之外的半透明背景。我得到的帽子是不透明的白色区域。背景设置背景:虚假工作。
var confirmInstance = $uibModal.open({
animation: true,
ariaLabelledBy: 'modal-title',
ariaDescribedBy: 'modal-body',
templateUrl: 'abc.html',
size: 'sm',
backdrop: false,
controller:function($uibModalInstance){
this.cancel = function() {
$uibModalInstance.dismiss('cancel');
};
this.ok=function(){
}
},
controllerAs:'$ctrl',
resolve: {
items: function() {
console.log("In resolve");
}
}
});
下面是模式的我的HTML代码:
<div><h1>Welcome here.. doing some more displaying stuff</h1></div>
<script type="text/ng-template" id="abc.html">
<div class="modal-header">
Remove {{$ctrl.type}}
<button type="button" class="close" data-dismiss="modal" ng-click="$ctrl.cancel()">×</button>
</div>
<div class="modal-body" id="modal-body">
<p>Confirm request for removal of {{$ctrl.type}} {{$ctrl.name}}?</p>
</div>
<div class="modal-footer">
<button class="btn-revoke" type="button" ng-click="$ctrl.ok()">Ok</button>
<button class="btn-cancel" type="button" ng-click="$ctrl.cancel()">Cancel</button>
</div>
</script>
在演示网站中正常工作,因此创建了一个重现问题的重陷。见[mcve] – charlietfl
是的,同样的例子在plunker中工作正常。那么为什么不在这里。 – FalconFlyer
你必须有不同的css或css冲突。需要检查适用于您的浏览器中的重叠规则的工具elemetns inspector – charlietfl