php - Wordpress 动画形状分隔线
问题描述
我一直在使用带有一些自定义 css 的动画形状分隔器,它正在从左到右制作波浪动画,但是当我切换到平板电脑或移动设备时,它奇怪地出现在主网站之外。
我一直在寻找一种代码解决方案来关闭它,但没有成功。我正在寻找一个代码,当有人要在平板电脑或手机上访问我的网站时,它会删除/阻止动画波。
我目前使用的 CSS
body {
overflow-x:hidden;
}
.elementor-shape-bottom {
bottom: -1px;
animation: wave 22s cubic-bezier( 0.36, 0.45, 0.63, 0.53) infinite;
width: 210%;
}
@keyframes wave {
0% {
margin-left: 0;
}
50% {
margin-left: -1600px;
}
100% {
margin-left: 0px;
}
}
body {
overflow-x:hidden;
}
.elementor-shape-top {
bottom: -1px;
animation: wave 22s cubic-bezier( 0.36, 0.45, 0.63, 0.53) infinite;
width: 210%;
}
@keyframes wave {
0% {
margin-left: 0;
}
50% {
margin-left: -1600px;
}
100% {
margin-left: 0px;
}
}
body {
overflow-x:hidden;
}
.elementor-shape {
bottom: -1px;
animation: wave 22s cubic-bezier( 0.36, 0.45, 0.63, 0.53) infinite;
width: 210%;
}
@keyframes wave {
0% {
margin-left: 0;
}
50% {
margin-left: -1600px;
}
100% {
margin-left: 0px;
}
}
解决方案
Elementordata-elementor-device-mode
在 body 标签上添加此属性以识别设备。这就是为什么需要两条不同的线路。第一行 CSS 将在您使用平板设备时应用,第二行将在您使用移动设备时应用。
在您的代码中添加此 CSS。
//This will stop animation on tablet device
body.elementor-default[data-elementor-device-mode="tablet"] .elementor-shape {
animation: unset;
}
//This will stop animation on mobile device
body.elementor-default[data-elementor-device-mode="mobile"] .elementor-shape {
animation: unset;
}
推荐阅读
- pandas-datareader - 将列值更改为单一格式
- javascript - 使用 Maven 将 typescript 编译为 javascript
- css - 想让 mat-table 的整行均匀地填充相同的颜色
- javascript - 如何使用纯javascript更新元素的onclick事件?
- java - 解释rxJava中的下游和上游
- android - 如何为应用内计费添加折扣价并在应用程序中显示?
- html - 打印用户输入但在数字之间添加新格式或字符?
- sql - SQL 中的案例表达式问题
- java - Spring中返回List的正确方法是什么
- python - 基于两个 numpy 数组和 matplotlib 创建的奇怪图