JQuery enables auto-text completion of special effects on Twitter,

Source: Internet
Author: User

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
});

Related Article

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.