背景:
1.按钮处于fixed定位
2.如果getContainer 设置成false,会导致弹窗位置异常
解决:
通过样式处理,并且此处的getContainer不用设置
body{
position: inherit!important;
width: auto!important;
overflow: revert!important;
}
本文介绍了一种解决fixed定位按钮触发弹窗时位置异常的方法。通过对body元素应用特定CSS样式,确保了即使getContainer设置为false时,弹窗也能正常显示。
背景:
1.按钮处于fixed定位
2.如果getContainer 设置成false,会导致弹窗位置异常
解决:
通过样式处理,并且此处的getContainer不用设置
body{
position: inherit!important;
width: auto!important;
overflow: revert!important;
}
3975
1万+