HTML5 Add lightweight responsive Typewriter Plugin tutorial

Source: Internet
Author: User

I. Methods of Use
<link rel= "stylesheet" type= "Text/css" href= "Typeit.css" >
<script src= "Jquery-2.1.4.min.js" ></script>
<script src= "Typeit.js" ></script>

Second, HTML structure
<span class= "Type-it" ></span>

Third, initialize the plug-in
<span class= "Type-it"
Data-typeit-whattotype= "A new string to type."
data-typeit-speed= "100"
Data-typeit-lifelike= "true"
Data-typeit-showcursor= "true" >
</span>
$ ('. Type-it '). Typeit ();

The second way is to pass in the configuration parameters when initializing the plug-in.
$ ('. Type-it '). Typeit ({
Whattotype: ' Enter your string here! ',
TYPESPEED:300,
Lifelike:false,
Showcursor:true
});

The typewriter plugin supports entering text for multiple sentences. By default, each sentence occupies one line, which appears from the top down. To use multiple lines of sentences, you only need to pass in an array.
$ ('. Type-it '). Typeit ({
whattotype:[' Enter your string here! ', ' another string! ']
});

You can also set the new center to overwrite the old sentence's typing effect, just set the Breaklines parameter to False.
$ ('. Type-it '). Typeit ({
Whattotype: [' Enter your string here! ', ' another string! '],
Breaklines:false
});

Four, callback function
After the text is printed, you can set a callback function to do other work.
$ ('. Typeit-box '). Typeit ({
Whattotype: ' Here is a string! ',
}, function () {
Console.log (' This is your callback function! ');
});

Keymob is currently the leading mobile advertising platform, dedicated to mobile app developers to create the best mobile advertising revenue, for tens of thousands of app advertisers to provide accurate wireless marketing and brand promotion services.

HTML5 Add lightweight responsive Typewriter Plugin tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.