zoukankan      html  css  js  c++  java
  • animatext.js使用介绍

    animatext.js文档

    animatext是一款简单的jquery文字动画特效插件。通过该jquery文字动画插件,你可以在显示一串文字时,添加多种炫酷的动画效果。

    使用方法
    在页面中引入jquery和animatext.min.js文件,如果需要额外的动画效果,可以添加animate.min.css动画库。

    <link rel="stylesheet" href="css/animate.min.css" type="text/css" />
    <script src="path/to/jquery.min.js"></script>
    <script src="path/to/animatext.min.js"></script>
    

      

    HTML结构
    你可以为任意标题文字,段落文字添加文字动画特效。例如:

    <h3 class="demo">青春,人生当中最美好的时光,不知不觉就会逝去,正因如此,我们才更加感怀青春。</h3>
    

      


    初始化插件
    在页面DOM元素加载完毕之后,可以通过animatext()方法来初始化该jquery文字动画特效插件。

    $(".demo").animatext();
    

      


    配置参数
    文字的显示分为单词和字母两种模式:

    // 字母模式
    $(".demo").animatext({
      mode: "chars"
    });
    // 单词模式
    $(".demo").animatext({
      mode: "words"
    });
    //可以通过reverse参数设置反向显示。
    $(".demo").animatext({
      reverse: true
    });
    //可以通过infinite参数设置无限循环显示。
    $(".demo").animatext({
      infinite: true
    });
    //可以通过speed参数设置文字动画的速度。
    $(".demo").animatext({
      speed: 150
    });
    //你还可以通过group参数来对文字进行分组。
    $(".demo").animatext({
      group: true
    });
    //可以通过random参数来设置随机显示文字。
    $(".demo").animatext({
      random: true
    });
    //initDelay参数用于设置显示文字的延迟时间。
    $(".demo").animatext({
      initDelay: 0
    });
    //timeToRelaunch参数用于设置两次循环文字动画之间的延迟时间。
    $(".demo").animatext({
      timeToRelaunch: 2000
    });
    

      


    最后,还有两个可用的回调函数。

    $(".demo").animatext({
      onBegin: function() {},
      onSuccess: function() {}
    });
    

      

    animatext jquery文字动画特效插件的github地址为:https://github.com/oscarlijo/animatext
    示例地址:http://www.oscarlijo.com/animatext/

  • 相关阅读:
    iOS企业证书网页分发全过程具体解释(图文并茂史无前例的具体哦)
    MySql按周/月/日分组统计数据的方法
    Linux
    video_capture模块分析
    Go语言核心之美 1.1-命名篇
    《JAVA程序设计》实训第二天——《猜猜看》游戏
    openssl之EVP系列之10---EVP_Sign系列函数介绍
    从字节码指令看重写在JVM中的实现
    Dalvik虚拟机垃圾收集(GC)过程分析
    call to OpenGL ES API with no current context 和Fatal signal 11
  • 原文地址:https://www.cnblogs.com/dreamboycx/p/13677876.html
Copyright © 2011-2022 走看看