html - WordPress : Issues in CSS animations in Mobile

标签 html css wordpress css-animations elementor

在我的 Elementor Pro 支持的网站中,我添加了自定义 CSS 来为 Shape Divider 设置动画。我有“刷波”风格作为形状分隔线。下面是代码

 .elementor-shape-bottom

 .elementor-shape-top

 .elementor-shape



body {
     overflow-x:hidden;
} 

@keyframes wave {
   0% {
     margin-left: 0;
   }
     50% {
     margin-left: -1600px;
   }
   100% {

     margin-left: 0px;
   }
 }  
   .elementor-shape-top {
     bottom: -1px;
     animation: wave 22s cubic-bezier( 0.36, 0.45, 0.63, 0.53) infinite;
     width: 210%;
 } 

 .elementor-shape-bottom {
     bottom: -1px;
     animation: wave 22s cubic-bezier( 0.36, 0.45, 0.63, 0.53) infinite;
     width: 210%;
 } 

@media only screen and (max-width: 768px) {
    .elementor-shape-top {
     bottom: -5px;
     animation: wave 22s cubic-bezier(  0.36, 0.45, 0.63, 0.53) infinite;
     width: 210%;
 } 

 .elementor-shape-bottom {
     bottom: -5px;
     animation: wave 22s cubic-bezier(  0.36, 0.45, 0.63, 0.53) infinite;
     width: 210%;
 } 
}
@media only screen and (max-width: 1920px) {

}

这在桌面上运行良好,但在平板电脑和移动设备上却不行。动画正在运行,但它与其他部分重叠。顶部动画与其顶部重叠,而底部动画与其底部重叠。

查看下面的示例。我该如何解决这个问题?

enter image description here

最佳答案

我认为问题是 body overflow-x 在手机和平​​板电脑上不起作用

尝试使用 div 包含您的内容

<body>
    <div class="wrapper">
        <div class="elementor-shape-bottom"></div>
        <div class="elementor-shape-top"></div>
        <div class="elementor-shape"></div>
    </div>
</body>

CSS

.wrapper{
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

关于html - WordPress : Issues in CSS animations in Mobile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57704883/

相关文章:

mysql - SQL 转换表 -> 将重复属性更改为列

mysql - 如何将 Prisma/GraphQL 连接到现有的 MySQL 数据库(特别是 WordPress)?

javascript mouseover/out 结合点击行为

javascript - 代码在 HTML 页面中有效,但在 Wordpress 帖子中无效

javascript - 创建一个简单的 google books api

html - 浏览器中的额外 anchor 标记

html - CSS - div定位/阴影影响其他

javascript - 新的时间戳都是同一个日期

javascript - Canvas - 在所有完全透明的区域填充一个矩形

javascript - 如何使用 serializeArray() 验证其默认值的表单字段。?