我正在使用Angular2-Draggable用于创建可拖动模式,但只有内容可以拖动并且背景是固定的。
我尝试通过将 angular2-draggable 指令选择器更改为 class ('.ngDraggable') 来修复此错误,但它不适用于父元素 (class='modal-dialog' role='document')
我使用下面的代码来显示模式:
this.modalService.show(OwnerAdvertisingOpportunityAddeditComponent,
{ initialState, class: 'ngDraggable modal-lg' });
有什么帮助或想法吗?
最佳答案
回答我自己的问题:
我用css解决了这个问题
.modal-dialog.ngDraggable {
.modal-content {
background-color: transparent;
border: none;
box-shadow: none;
}
.ngDraggable {
box-shadow: 0 5px 15px rgba(0,0,0,.5);
border-radius: 6px;
border: 1px solid #999;
overflow: hidden;
}
}
但是如果有人有更好的解决方案,感谢分享
关于angular - 可拖动的 ngx-bootstrap 模态仅 body 移动和背景固定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61654329/