The dropdown menu supports input and automatically locates according to the input content

Source: Internet
Author: User
The Drop-down menu supports input and is automatically positioned according to the input content:
Reference: The actor is published in the 10/23/2001 8:58:16 AM article "Lofty's decryption simplified version of the removable dropdown box." In this special thanks to the relevant people.
This article adds a little bit of functionality to the Drop-down box: The input can be positioned in an existing selection box. There is also a disadvantage, you have to change: when the input can not automatically pull off the selection box, how to do?
function Getleftpostion (theobj)
{
var pos = 0;
while (theobj!= null)
{
POS + theobj.offsetleft;
Get the Object which contain theobj.
Theobj = theobj.offsetparent;
}
return POS;
}
function Gettoppostion (theobj)
{
var pos = 0;
while (theobj!= null)
{
POS + theobj.offsettop;
Get the Object which contain theobj.
Theobj = theobj.offsetparent;
}
return POS;
}
function Checkversion ()
{
var isbadversion=true;
var curver=navigator.appversion;
var pos=parseint (Curver.indexof ("MSIE"));
if (pos>=1)
{
var intver=parseint (Curver.charat (pos+5));
if (intver>=5)
{isbadversion=false;}
}
if (isbadversion)
{
var msg= "This page could be displayed properly:" +
"This product requires Microsoft Internet Explorer 5 or later browser only.";
Alert (msg);

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.