var?intIndex=0;arrList?=?new?Array();?
function?test()??
{?
?????
????dearray("1111,222,222a,aaa,aa1,bb,b222,b3,323313,3213,32213,dsfsdddd");?
????smanPromptList(arrList,"inputer1");?
????smanPromptList(arrList,"inputer2");?
????smanPromptList(arrList,"inputer3")?
}?
????
function?dearray(aa)//¶¨Òåarray?
{?
????arrList?=?aa.split(¡¯,¡¯);?
?????
}?
function?getAbsoluteWidth(ob)?
{?
????????return?ob.offsetWidth?
}?
function?smanPromptList(arrList,objInputId){?
????????var?objouter=document.getElementById("__smanDisp")?//ÏÔʾµÄDIV¶ÔÏó?
????????var?objInput?=?document.getElementById(objInputId);?//Îı¾¿ò¶ÔÏó?
????????var?selectedIndex=-1;?
????????var?intTmp;?//Ñ»·ÓõÄ:)?
????????if?(objInput==null)?{alert(¡¯smanPromptList³õʼ»¯Ê§°Ü:ûÓÐÕÒµ½"¡¯+objInputId+¡¯"Îı¾¿ò¡¯);return?;}?
????????????//Îı¾¿òʧȥ½¹µã?
????????????objInput.onblur=function(){?
????????????????objouter.style.display=¡¯none¡¯;?
????????????}?
????????????//Îı¾¿ò°´¼ü̧Æð?
????????????objInput.onkeyup=checkKeyCode;?
????????????//Îı¾¿òµÃµ½½¹µã?
????????????objInput.onfocus=checkAndShow;?
????????????function?checkKeyCode(){?
????????????????var?ie?=?(document.all)??true:false?
????????????????if?(ie){?
????????????????????var?keyCode=event.keyCode?
????????????????????if?(keyCode==40||keyCode==38){?//ÏÂÉÏ?
????????????????????????var?isUp=false?
????????????????????????if(keyCode==40)?isUp=true?;?
????????????????????????chageSelection(isUp)?
????????????????????}else?if?(keyCode==13){//»Ø³µ?
????????????????????????outSelection(selectedIndex);}else{?
????????????????????????checkAndShow()?
????????????????????}?
????????????????}else{?
????????????????????checkAndShow()?
????????????????}?
????????????????divPosition()?
????????????}?
????????????function?checkAndShow(){?
????????????????????????var?strInput?=?objInput.value?
????????????????????????if?(strInput!=""){?
????????????????????????????divPosition();?
????????????????????????????selectedIndex=-1;?
????????????????????????????objouter.innerHTML?="";?
????????????????????????????for?(intTmp=0;intTmp<arrlist.length;inttmp++){?>
????????????????????????????????if?(arrList[intTmp].substr(0,?strInput.length)==strInput){?
????????????????????????????????????addOption(arrList[intTmp]);?
????????????????????????????????}?
????????????????????????????}?
????????????????????????????objouter.style.display=¡¯¡¯;?
????????????????????????}else{?
????????????????????????????objouter.style.display=¡¯none¡¯;?
????????????????????}function?addOption(value){?
????????????????????????objouter.innerHTML?+="<div?onmouseover="this.classname=¡¯sman_selectedstyle¡¯"?onmouseout="this.classname=¡¯¡¯"?onmousedown="document.getelementbyid(¡¯"+objinputid+"¡¯).value=¡¯"?+?value?+?"¡¯">"?+?value?+?"
"?????
????????????????????}?
????????????}?
????????????function?chageSelection(isUp){?
????????????????if?(objouter.style.display==¡¯none¡¯){?
????????????????????objouter.style.display=¡¯¡¯;?
????????????????}else{?
????????????????????if?(isUp)?
????????????????????????selectedIndex++?
????????????????????else?
????????????????????????selectedIndex--?
????????????????}?
????????????????var?maxIndex?=?objouter.children.length-1;?
????????????????if?(selectedIndex<0){selectedIndex=0}?
????????????????if?(selectedIndex>maxIndex)?{selectedIndex=maxIndex}?
????????????????for?(intTmp=0;intTmp<=maxIndex;intTmp++){?
????????????????????if?(intTmp==selectedIndex){?
????????????????????????objouter.children[intTmp].className="sman_selectedStyle";?
????????????????????}else{?
????????????????????????objouter.children[intTmp].className="";?
????????????????????}?
????????????????}?
????????????}?
????????????function?outSelection(Index){?
????????????????objInput.value?=?objouter.children[Index].innerText;
objouter.style.display=¡¯none¡¯;?
????????????}?
????????????function?divPosition(){?
????????????????var?clx,cly;?
????????????????clx=event.clientX;?
????????????????cly?=?event.clientY;?
????????????????objouter.style.top????=?cly+10;?
????????????????objouter.style.left????=?clx+20;??
????????????????objouter.style.width=?getAbsoluteWidth(objInput)?
????????????}?
????}?
????document.write("<div?id=¡¯__smandisp¡¯?style=¡¯;display:none;background:#e8f7eb;border:?1px?solid?#cccccc;font-size:14px;cursor:?default;¡¯?onbulr>?
");?
????document.write("
<style>.sman_selectedStyle{background-Color:#102681;color:#FFFFFF}</style>
");?
id="table1"?style="BORDER-COLLAPSE:?collapse"??></div?id=¡¯__smandisp¡¯?style=¡¯;display:none;background:#e8f7eb;border:?1px?solid?#cccccc;font-size:14px;cursor:?default;¡¯?onbulr>
分享到:
相关推荐
1 ÐÂËã·¨Éè¼ÆµÄ×ÜÌå˼Ïë ÈçÉÏËùÊö£¬¼òµ¥µÄÄ£ºý²é±í·¨Ë...ÌåÏÖ³ö¸Ã¹æÔòµÄÔÀí¡£Õâ¾ÍÊÇ×ÔÐÞÕýÒò×Ó·¨µÄ»ù±¾Ë¼ ·¡£
基于STi7105高清机顶盒实现视频通话.zipµÆ»É¼¼Ê×ÁÏÔ基于STi7105高清机顶盒实现视频通话.zipµÆ»É¼¼Ê×ÁÏÔ基于STi7105高清机顶盒实现视频通话.zipµÆ»É¼¼Ê×ÁÏÔ基于STi7105高清机顶盒...
9累减单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ9累减单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ 1.º¸ÈÑϼÊ×ÏIJ¿ 2.ʺÑÉ×±Òɼ²¿ 3.ʺµÆ»¹Ë¿·ÏIJ¿
9累加单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ9累加单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ 1.º¸ÈÑϼÊ×ÏIJ¿ 2.ʺÑÉ×±Òɼ²¿ 3.ʺµÆ»¹Ë¿·ÏIJ¿
4c02存储花样流水灯单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ4c02存储花样流水灯单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ 1.º¸ÈÑϼÊ×ÏIJ¿ 2.ʺÑÉ×±Òɼ²¿ 3.ʺµÆ»¹Ë¿·ÏIJ¿
4c02存储多个数据单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ4c02存储多个数据单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ 1.º¸ÈÑϼÊ×ÏIJ¿ 2.ʺÑÉ×±Òɼ²¿ 3.ʺµÆ»¹Ë¿·ÏIJ¿
24c02存储上次使用中状态单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ24c02存储上次使用中状态单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ 1.º¸ÈÑϼÊ×ÏIJ¿ 2.ʺÑÉ×±Òɼ²¿ 3.ʺµÆ»¹Ë¿·...
12位AD_DS1621与12864液晶单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ12位AD_DS1621与12864液晶单片机C语言源码.zipÏijÐCÓÑÔÂÏÔ 1.º¸ÈÑϼÊ×ÏIJ¿ 2.ʺÑÉ×±Òɼ²¿ 3.ʺµÆ»¹Ë¿...
}else{//Èç¹ûµ±Ç°ÏÔʾµÄÂÌÉ«Öù×Ӹ߶ÈСÓÚ֮ǰµÄÖù×ÓÔòÐèÒª½«¶àÓàµÄÂÌÉ«Öù×ÓÓñ³¾°É«Ìî³ä LCD_Fill(RedNewHeight[i],(BarWidth+2)*...
#include <hidef.h> /* common defines and ...////////³öÏÖ²¨¶¯Çé¿öϵÄÊÕÁ² ui xiuzhengliang;/////////ͨ¹ýÁ¬Ðø¼Ç¼µÃµ½µÄ·¾¶¶Ôµ±Ç°¶æÁ¿½øÐÐÐÞÕý
µÚÒ»´Î°²×°Ê±ÒªÇóÌṩÐòÁкſÉʹÓÃÊÔÓðæµÄ£º 898724-355633-859461-053221 °²×°ºÃºóÔÙÓÃËù´øµÄ¹¤¾ßcr-sql25Éú³É×¢²áºÅÀ´×¢²á¾...
ʵÏÖÏÖÏó£ºÏÂÔسÌÐòºó£¬·äÃùÆ÷²¥·ÅÒôÀÖ ×¢ÒâÊÂÏ ***************************************************************************************/ #include "reg52...
安防系统通用图形符号.zipÊÄɼCADÍ¿dwg¸ÊÏÔ安防系统通用图形符号.zipÊÄɼCADÍ¿dwg¸ÊÏÔ 1.ʺÑÉÖ׸Öɼ²¿ 2.ʺ¸ÈÖ׸Öɼ²¿ 3.ʺ¹ËÖ׸Öɼ²¿
ÓɳÂÓ£¬Âí±ó£¬»ª³É£¬Ìïê¿»Ô£¬ÍõÑó£¬ÕÅÒæç⣬¶ÅæÂ棬·ëºì࣬ÀîÄ꣬ÁõÀö¾ê¿ª·¢£» ¿ª·¢Ê±¼äÊÇ2003.10¡ª¡ª2003.12£...
¹Øע΢ÐŹ«ÖÚƽ̨΢Ðźţº"ÕýµãÔ×Ó"£¬Ãâ·Ñ»ñÈ¡STM32×ÊÁÏ¡£ ¹ãÖÝÊÐÐÇÒíµç×ӿƼ¼ÓÐÏÞ¹«Ë¾ ×÷ÕߣºÕýµãÔ×Ó @...
/* ´ò¿ª¶¨Ê±Æ÷3µÄ¹¦ÂÊ¿ØÖÆ */ LPC_TIM3->CTCR = (2 ) | /* ¼ÆÊýÆ÷ģʽ,ϽµÑز¶»ñ */ (0 ); /* Ñ¡ÔñCAP1.5 */ LPC_TIM3->TC = 0; /* ³õʼ»¯¼ÆÊýÆ÷Öµ...
//ÓÃÓÚ¿ØÖÆ°´¼üÈ¥¶¶¶¯²Ù×÷¡£1£ºÉ¨ÃèʱÏû¶¶ 2£ºµÈ´ýÊÍ·Å 3£ºÊÍ·ÅʱÏû¶¶ #define LEDPORT P0 //¶¨ÒåÏÔʾÆ÷¶ÎÂëÊä³ö¶Ë¿Ú #...
/*ÕâÀïÒ»¶¨ÒªÉè³ÉÊäÈëÉÏÀ£¬·ñÔò²»ÄܶÁ³öÊý¾Ý*/ GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Pin = sda; GPIO_Init(GPIOB, &GPIO;_Init...
¹Øע΢ÐŹ«ÖÚƽ̨΢Ðźţº"ÕýµãÔ×Ó"£¬Ãâ·Ñ»ñÈ¡STM32×ÊÁÏ¡£ ¹ãÖÝÊÐÐÇÒíµç×ӿƼ¼ÓÐÏÞ¹«Ë¾ ×÷ÕߣºÕýµãÔ×Ó @...