簡體   English   中英

在typed.js文本中鏈接

[英]Link in typed.js text

如何在typed.js腳本中放置鏈接? 我需要聯系我,鏈接到聯系頁面。

    <script src="js/typed.js"></script>
    <script>
      $(function(){
          $(".element").typed({
            strings: ["Welcome to my Website.", "Random text... Contact me"],
            typeSpeed: 0
          });
      });
    </script>

 **HTML**

<div class="col-md-12 col-xs-12">
    <h1 class="element"></h1>
 </div>

使用callback參數。

例:

 $(function() { $('#awesome').typed({ strings: ["Welcome to my Website.", "Random text... Contact me"], typeSpeed: 0, callback: function() { $('#awesome').html('<a href="#">' + $('#awesome').html() + '</a>') } }); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://raw.githubusercontent.com/mattboldt/typed.js/master/js/typed.js"></script> <div class="col-md-12 col-xs-12"> <h1 class="element" id="awesome"></h1> </div> 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM