在 平滑动画 文本之间切换 jQuery动画标题

  • 源码大小:8.57KB
  • 所需积分:1积分
  • 源码编号:19JP-3809
  • 浏览次数:3675次
  • 最后更新:2023年07月25日
  • 所属栏目:动画
本站默认解压密码:19jp.com 或 19jp_com

简介

一个jQuery插件,通过使用7个CSS3支持的平滑过渡效果在文本之间切换来创建令人印象深刻的标题。

请参阅实际操作:

如何使用它:

1.在页面上包含jQuery库和动画标题插件的文件。

  1. <link rel="stylesheet" href="/path/to/jquery.animatedheadline.css" />
  2. <script src="/path/to/cdn/jquery.min.js"></script>
  3. <script src="/path/to/jquery.animatedheadline.min.js"></script>

2.将标题添加到页面中。

  • 旋转-1(默认)
  • 旋转-2
  • 旋转-3
  • 规模
  • 类型
  • 夹子
  • 装载杆
  1. <div class="selector" style="display: flex; justify-content: center; text-align: center;">
  2. <h1 class="ah-headline" style="text-align: center;">
  3. <span>I Love </span>
  4. <span class="ah-words-wrapper">
  5. <b class="is-visible">jQueryScript.Net</b>
  6. <b>CSSScript.Com</b>
  7. <b>VueScript.Com</b>
  8. </span>
  9. </h1>
  10. </div>

3.初始化顶部容器上的插件,并指定动画类型:

  1. $(function() {
  2. $('.selector').animatedHeadline({
  3. animationType: 'scale'
  4. });
  5. })

4.配置过渡效果:

  1. $('.selector').animatedHeadline({
  2. animationDelay: 2500,
  3. barAnimationDelay: 3800,
  4. barWaiting: 800,
  5. lettersDelay: 50,
  6. typeLettersDelay: 150,
  7. selectionDuration: 500,
  8. typeAnimationDelay: 1300,
  9. revealDuration: 600,
  10. revealAnimationDelay: 1500
  11. });

预览截图