首页 > 解决方案 > 横幅上的移动标题动画

问题描述

我的英雄图像内容有一个动画,从 3/4 帧开始。但是,当标题再次重复时,它会从第 3/4 帧开始。

我希望从第二次到最后一个字母离开框架时,“下一个”句子的第一个字母已经在另一端开始了。你能帮我解决这个问题吗?

这是网站链接:http: //54.91.174.201/

@keyframes home_hero1 {
  0% {
    margin-left: 30%;
  }
  100% {
    margin-left: -4400px;
  }
}

@keyframes home_hero2 {
  0% {
    margin-right: 30%;
  }
  100% {
    margin-right: -4400px;
  }
}

.heading_h1 {
  font-size: 150px;
  letter-spacing: 12.5px;
  position: absolute;
  bottom: 50px;
  left: 0;
  line-height: 2;
  white-space: nowrap;
  -moz-animation: home_hero1 21s linear 0s infinite;
  -webkit-animation: home_hero1 21s linear 0s infinite;
}

.heading_h2 {
  font-size: 150px;
  letter-spacing: 12.5px;
  position: absolute;
  top: 50px;
  right: 0;
  line-height: 1.5;
  white-space: nowrap;
  -moz-animation: home_hero2 23s linear 0s infinite;
  -webkit-animation: home_hero2 23s linear 0s infinite;
}
<div class="inner-hero-left">
  <h2 class="heading_h1">
    <span class="underline--magical">98% PLANT & NATURALLY DERIVED INGREDIENTS*</span>
  </h2>
  <h2 class="heading_h2"><span class="underline--magical show-on-scroll">98% PLANT & NATURALLY DERIVED INGREDIENTS*</span>
  </h2>
</div>

标签: javascripthtmljquerycssanimation

解决方案


推荐阅读