角引导模式$活跃的背景元素 [英] Angular Bootstrap $modal with active background elements

查看:124
本文介绍了角引导模式$活跃的背景元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,实现引导模式,(我用的角 $模式服务),其中的背景元素应该保持活跃,也就是说即使有模式打开,背景DOM必须是可用/点击。我已经尝试设置背景= FALSE $模式属性,但它不能正常工作。

I have a requirement to implement Bootstrap modal, (I use angular $modal service) where the background elements should remain active, i.e even with the modal open, the background DOM must be usable / clickable. I have tried setting backdrop = false in the $modal properties but it doesn't work.

推荐答案

您可以简单地隐藏模式叠加使用CSS:

You can simply hide modal overlay with CSS:

.modal-backdrop {
    display: none;
}
.modal {
    left: 50%;
    right: inherit;
    top: 50%;
    bottom: inherit;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}

有关,这也确保您添加背景:静态模态配置,以prevent模态接近身体上点击

For this also make sure you add backdrop: 'static' to modal configuration to prevent modal close on body click.

演示: http://plnkr.co/编辑/ 46M6F7BL9FtQqt9WiBuJ?p = preVIEW

这篇关于角引导模式$活跃的背景元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆