引用核心JS

将代码放在 设置外观--开发者设置--自定义输出head头部的HTML代码

<script src="https://blog.x5mgc.com/js/typed.min.js"></script>

获取一言JS

将下方代码放在 设置外观--开发者设置--自定义JavaScript

function typedword(){
    $.ajax({
                  type:"get",
                  url:"https://api.dzzui.com/api/yiyan?format=json2",
                  data:{page:'index'},
                  async:true,
     success:function(word){
                  var list=[];
                   for(var i=0;i<word.data.length;i++){
                   list.push(word.data[i]['text'])
                   }
      $("#word").typed({
                   strings:list,
                   typeSpeed:20,
                   loop:true,
                   backDelay:3000,})
                   }
           })
        }

显示输出

最后把下面这行代码放在后台 - 初级设置 - 首页一行文字介绍 中

<p><i style="color:red;" class="glyphicon glyphicon-heart" aria-hidden="true"></i><span id="word"><i class="glyphicon glyphicon-heart" aria-hidden="true"></i></span><i style="color:red;" class="glyphicon glyphicon-heart" aria-hidden="true"></i><script>$(function(){typedword();})</script></p>
Last modification:October 7th, 2021 at 01:58 pm