JQuery enables auto-text completion of special effects on Twitter,
The effect can be achieved using the jQuery plug-in Typeahead. js. This jQuery plug-in comes from a new Twitter project and supports remote and local datasets. The difference is that you can use local storage to store datasets locally, effectively improving the user experience. At the same time, it also has many options for processing remote datasets, such as (request frequency, maximum number of concurrent requests, and so on ).
Main features
Supports local data storage, client loading, and optimized loading speed
Supports multiple languages and Arabic
Support for Hogan. js template engine integration
Support multi-dataset assembly
Supports local and remote datasets
Project address
Http://twitter.github.io/typeahead.js
How to Use
First, introduce the js and CSS files related to the jQuery framework and Typeahead. JS plug-in to the webpage head.
Copy codeThe Code is as follows:
<Link href = "typeahead.min.css" rel = "stylesheet">
<Script src = "jquery-1.9.1.min.js"> </script>
<Script src = "typeahead. min. js"> </script>
ThenAdd HTML elements to be animated, Such
Copy codeThe Code is as follows:
<Input id = "demo" class = "typeahead" type = "text" placeholder = "test">
LastInitialization
Copy codeThe Code is as follows:
View source
$ ('# Demo'). typeahead ({
Name: 'test ',
Local: ["Site518", "Lwolf"],
Limit: 10
});