JS class Baidu dynamic Cue box thinking and completion

Source: Internet
Author: User

The reference code comes from here:

Http://www.jb51.net/article/28075.htm

But to tell the truth, this site is too rotten, not suitable to look at the code, another code is a Daniel, but there is no modular thinking, so I am not happy to use directly, simply is the weekend to spend time to write a bar.

Clarify the requirements:

An input box is required, after the user input (KeyUp event), the user input is returned to the outside, and the external information is obtained from the input box, displayed

Other than that:

1, in the loss of focus, need to eliminate the prompt box

2, need to block the browser's original prompt function

3, listen to the keyboard up and down, loop Select Prompt item

4. Reposition the Cue box when the window position changes

Module structure:

function Autocompleteinput (input,callback) {    this. input = input;     this. callBack = callBack;} /*  */function(TXT) {};

Simple enough, huh? Ha, the following is realized, please look forward to it, it is estimated that the evening can be finished.

JS class Baidu dynamic Cue box thinking and completion

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.