简体   繁体   English

在typed.js文本中链接

[英]Link in typed.js text

How do i put link in typed.js script? 如何在typed.js脚本中放置链接? I need Contact me, to be linked to contact page. 我需要联系我,链接到联系页面。

    <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>

Use the callback parameter. 使用callback参数。

Example: 例:

 $(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