gpt4 book ai didi

css 转换导致 chrome 模态闪烁

转载 作者:太空宇宙 更新时间:2023-11-04 09:16:32 26 4
gpt4 key购买 nike

我使用 semantic-ui 创建了一个模式。当我点击一个按钮时,模态打开。我修改了模态的 css 属性如下:

#modal {
width: 400px !important;
transform: translate(50%, -50%) !important;
right: 50% !important;
left: auto !important;
top: 50% !important;
margin: auto !important;
position: fixed;
}

当我点击 chrome 或 edge 浏览器上的按钮时,模式打开,几秒钟后它跳转到一个新位置。 Firefox 不显示此问题。
另外,如果我删除 transform: translate(50%, -50%) !important;线,我没有看到问题

你可以在这个代码笔中看到问题: http://codepen.io/masoudhosseini/pen/rjjpbd

最佳答案

最后我发现了问题,我需要禁用模态动画才能在 chrome 和 edge 中正确显示:

$("#btn").click(function(e){
e.preventDefault();
$("#modal").modal({
blurring: true,
duration: 0
}).modal('show');
});

关于css 转换导致 chrome 模态闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41733036/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com