淡入淡出从换行符的底部开始. CSS/JS [英] Fade reveal text from bottom of line break. CSS / JS

查看:146
本文介绍了淡入淡出从换行符的底部开始. CSS/JS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我需要实现一个非常不错的淡入淡出显示文本效果.想象一下一个H1分布在两行中.文本需要从每行的底部开始显示.但是我不确定如何使用多行文本(不会分成单独的标题标签).

So, I need to achieve a really nice fade reveal text effect. Imagine a H1 that's spread across two lines. The text would need to reveal up from the base of each line. However I'm unsure of how to do this with multi-lined text (that isn't split into separate heading tags).

这是我已经创建的一个,但是这会使所有内容从底部消失.理想情况下,我希望每行从其自己的行中消失.

Here's one I created already, however this fades everything from the bottom. Ideally I want each line to fade up from its own row.

setTimeout(function(){ 
		$('.ready').addClass('active');
}, 1500);

.overflow-hidden {
    overflow:hidden;
}

h1 {
  padding:0;
  max-width:500px;
  margin:0;
  font-family:sans-serif;
}

.ready {
  opacity:0;
  transform: translateY(50px);
}

.active {
  opacity:1;
  transform: translateY(0px);
}

.reveal-in {
  -webkit-transition: all 600ms ease-in-out;
  -moz-transition: all 600ms ease-in-out;
  -ms-transition: all 600ms ease-in-out;
  -o-transition: all 600ms ease-in-out;
  transition: all 600ms ease-in-out;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="overflow-hidden iv-wp">
    <h1 class="ready reveal-in">
      This is text over two lines, with a really nice fade effect.
    </h1>
</div>

类似于此参考-

https://basicagency.com/

谢谢大家.

推荐答案

您可以使用 Animate.css 十分易于使用.您可以在此处查看演示.

You can use Animate.css which is quite easy to use. You can check the demo here.

所有您需要做的就是添加一个类名,该类名是animated,以及您选择的动画,可以在提供的链接上找到.您可以选择slideInDownslideInUp或更多.检查并使用我提供的演示链接.

All you need to do is to add a class name which is animated and your choice of animation which can be found on the link provided. You can choose slideInDown or slideInUp or more. Check and play with the demo link that I have provided.

添加了工作小提琴

这篇关于淡入淡出从换行符的底部开始. CSS/JS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆