farmhouse
BlogJava
首頁(yè)
新隨筆
聯(lián)系
聚合
管理
隨筆-1 評(píng)論-4 文章-15 trackbacks-0
城市、日歷選擇,含輸入提示功能,非常酷的效果
功能似乎很強(qiáng)大!
<head> <style type="text/css"> body{ font-family:"宋體"; font-size:12px; } </style> <title>test</title> <script type="text/javascript"> //************通用函數(shù)(來(lái)自pyzy.net)Sta huzj 2008-4-12************// function $(fctId){ return document.getElementById(fctId); } //取得某對(duì)象,若提供ID下的對(duì)象不存在則自動(dòng)創(chuàng)建 function c$(fctId,fctClassName){ var varTempDivObj=$(fctId); if(!varTempDivObj){ GetPyzyIframe("ifm"+fctId); varTempDivObj=document.createElement("div"); varTempDivObj.id=fctId; if(fctClassName && fctClassName!="")varTempDivObj.className=fctClassName; document.body.appendChild(varTempDivObj); } return varTempDivObj; } //取得某ID的iframe對(duì)象,若不存在該ID的對(duì)象則自動(dòng)創(chuàng)建 function GetPyzyIframe(fctIfmId,fctVisibility,fctTop,fctLeft,fctWidth,fctHeight){ var varTempIfmObj=$(fctIfmId); if(!varTempIfmObj){ varTempIfmObj=document.createElement("iframe"); varTempIfmObj.id=fctIfmId; varTempIfmObj.style.position="absolute"; varTempIfmObj.style.zIndex="1"; varTempIfmObj.style.visibility="hidden"; document.body.appendChild(varTempIfmObj); } if(fctTop)varTempIfmObj.style.top=fctTop+"px"; if(fctLeft)varTempIfmObj.style.left=fctLeft+"px"; if(fctWidth)varTempIfmObj.style.width=fctWidth+"px"; if(fctHeight)varTempIfmObj.style.height=fctHeight+"px"; if(fctVisibility)varTempIfmObj.style.visibility=(document.all?fctVisibility:"hidden"); return varTempIfmObj; } //取得某對(duì)象的坐標(biāo)位置、寬、高 function getPosition(obj){ var top=0; var left=0; var width=obj.offsetWidth; var height=obj.offsetHeight; while(obj.offsetParent){ top+=obj.offsetTop; left+=obj.offsetLeft; obj=obj.offsetParent; } return{"top":top,"left":left,"width":width,"height":height}; } //取得編碼存儲(chǔ)框?qū)ο? function GetValueToInputObj(fctThisObj){ if(!fctThisObj)return null; var varThisObjAutoInput=(fctThisObj.getAttributeNode("value_to_input")?fctThisObj.getAttributeNode("value_to_input").value:""); if(varThisObjAutoInput=="")return null; return $(varThisObjAutoInput); } //自動(dòng)觸發(fā)下一個(gè)對(duì)象的Act事件 function AutoNextInputAct(fctThisObj,fctAct){ var varNextInput=fctThisObj.getAttributeNode("nextinput"); if(varNextInput && varNextInput!=""){ if(document.all){ eval("$('"+varNextInput.value+"')."+fctAct+"()"); }else{ var evt = document.createEvent("MouseEvents"); evt.initEvent(fctAct,true,true); $(varNextInput.value).dispatchEvent(evt); } $(varNextInput.value).focus(); } } //給某對(duì)象的某事件增加處理函數(shù)AddFunToObj(document,"onclick","alert('1');") function AddFunToObj(fctObj,fctAct,fctFunction){ if(fctObj.addEventListener){ //!IE fctObj.addEventListener(fctAct.replace("on",""),function(e){ e.cancelBubble=!eval(fctFunction); },false); }else if(fctObj.attachEvent){ //IE fctObj.attachEvent(fctAct,function(){ return eval(fctFunction); }); } } //************通用函數(shù) End huzj 2008-4-12************// /**********城市列表功能 Sta huzj 2008-4-14*************/ //輸出城市列表菜單CSS樣式 huzj 2008-4-12 document.write('\ <style type="text/css">\ body{background-color:#efefef;}\ #divAddressMenu {position:absolute;visibility:hidden;z-index:1;overflow:hidden;width:172px;background-color:#FFFFFF;border:solid #EBcccC 1px;font-size:12px;}\ #divAddressMenu h4{border-bottom:dotted #CCCCCC 1px;color:#999999;font-size:12px; font-weight:100; padding:2px 2px 0 2px; margin:0;}\ #divAddressMenu div{border:solid #FC7A7D 1px;padding:1px;}\ #divAddressMenu a {display:block;width:162px !important;width:100%;padding:1px 2px 2px 2px;cursor:default;text-decoration:none;color:#990000;border:solid #ffffff 1px;background-color:none;}\ #divAddressMenu a span{float:right;}\ #divAddressMenu a:hover {border:solid #F2C2BD 1px;background-color:#FBEDEC;}\ </style>\ '); var varAddress="@Akesu|阿克蘇|AKU@Aletai|阿勒泰|AAT@Ankang|安康|AKA@Anqing|安慶|AQG@Anshun|安順|AVA@Anting|安亭|594@Baise|百色|AEB@Baoshan|保山|BSD@Baotou|包頭|BAV@Beihai|北海|BHY@Beijing|北京|BJS@Changchun|長(zhǎng)春|CGQ@Changde|常德|CGD@Changdu|昌都|BPX@Changsha|長(zhǎng)沙|CSX@Changzhi|長(zhǎng)治|CIH@Changzhou|常州|CZX@Chaoyang|朝陽(yáng)|CHG@Chengdu|成都|CTU@Chifeng|赤峰|CIF@Chongqing|重慶|CKG@Dali|大理|DLU@Dalian|大連|DLC@Dandong|丹東|DDG@Datong|大同|DAT@Daxian|達(dá)縣|DAX@Dehong|德宏|LUM@Diqing|迪慶|DIG@Dongying|東營(yíng)|DOY@Dunhuang|敦煌|DNH@Enshi|恩施|ENH@Fuyang|阜陽(yáng)|FUG@Fuzhou|福州|FOC@Ganzhou|贛州|KOW@Geermu|格爾木|GOQ@Guanghan|廣漢|GHN@Guanghua|光化|LHK@Guangzhou|廣州|CAN@Guilin|桂林|KWL@Guiyang|貴陽(yáng)|KWE@Haerbin|哈爾濱|HRB@Haikou|海口|HAK@Hailaer|海拉爾|HLD@Handan|邯鄲|HDG@Hangzhou|杭州|HGH@Hanzhong|漢中|HZG@Hefei|合肥|HFE@Heihe|黑河|HEK@Hetian|和田|HTN@Hong Kong|香港|HKG@Huangshan|黃山|TXN@Huangyan|黃巖|HYN@Huhehaote|呼和浩特|HET@Jiamusi|佳木斯|JMU@Jiayuguan|嘉峪關(guān)|JGN@Jilin|吉林|JIL@Jinan|濟(jì)南|TNA@Jingdezhen|景德鎮(zhèn)|JDZ@Jinggangshan|井岡山|JGS@Jinghong|景洪|JHG@jinjiang|晉江|JJN@Jinzhou|錦州|JNZ@Jiujiang|九江|JIU@Jiuzhaigou|九寨溝|JZH@Kaohsiung|高雄|KHH@Kashi|喀什|KHG@Kelamayi|克拉瑪依|KRY@Kuche|庫(kù)車|KCA@Kuerle|庫(kù)爾勒|KRL@Kunming|昆明|KMG@Lanzhou|蘭州|LHW@Lasa|拉薩|LXA@LiangPing|梁平|LIA@Lianyungang|連云港|LYG@Lijiang|麗江|LJG@Lincang|臨滄|LNJ@Linxi|林西|LXI@Linyi|臨沂|LYI@Linzhi|林芝|LZY@LIPING|黎平|HZH@Liuzhou|柳州|LZH@LONGYAN|龍巖|LCX@Luoyang|洛陽(yáng)|LYA@Luzhou|瀘州|LZO@Macau|澳門(mén)|MFM@Mangshi|芒市|LUM@Manzhouli|滿洲里|NZH@Meixian|梅縣|MXZ@Mianyang|綿陽(yáng)|MIG@Mudanjiang|牡丹江|MDG@Nanchang|南昌|KHN@Nanchong|南充|NAO@Nanjing|南京|NKG@Nanning|南寧|NNG@Nantong|南通|NTG@Nanyang|南陽(yáng)|NNY@Ningbo|寧波|NGB@Panzhihua|攀枝花|PZI@Qingdao|青島|TAO@Qingyang|慶陽(yáng)|IQN@Qinhuangdao|秦皇島|SHP@Qiqihaer|齊齊哈爾|NDG@Quanzhou|泉州|JJN@Quzhou|衢州|JUZ@Sanya|三亞|SYX@Shanghai|上海|SHA@Shantou|汕頭|SWA@Shashi|沙市|SHS@Shenyang|沈陽(yáng)|SHE@Shenzhen|深圳|SZX@Shijiazhuang|石家莊|SJW@Shishi|石獅|JJN@Simao|思茅|SYM@Tacheng|塔城|TCG@Taipei|臺(tái)北|TPE@Taiyuan|太原|TYN@Tianjin|天津|TSN@Tongliao|通遼|TGO@Tongren|銅仁|TEN@Wanxian|萬(wàn)州|WXN@Weifang|濰坊|WEF@Weihai|威海|WEH@Wenshan|文山|WNH@Wenzhou|溫州|WNZ@Wuhai|烏海|WUA@Wuhan|武漢|WUH@Wulanhaote|烏蘭浩特|HLH@Wulumuqi|烏魯木齊|URC@Wuxi|無(wú)錫|WUX@Wuyishan|武夷山|WUS@Xiamen|廈門(mén)|XMN@Xian|西安|SIA@Xiangfan|襄樊|XFN@Xianggelila|香格里拉|DIG@Xichang|西昌|XIC@Xilinhaote|錫林浩特|XIL@Xingyi|興義|ACX@Xining|西寧|XNN@Xishuangbanna|西雙版納|JHG@Xuzhou|徐州|XUZ@Yanan|延安|ENY@Yancheng|鹽城|YNZ@Yanji|延吉|YNJ@Yantai|煙臺(tái)|YNT@Yibin|宜賓|YBP@Yichang|宜昌|YIH@Yinchuan|銀川|INC@Yining|伊寧|YIN@Yiwu|義烏|YIW@Yongzhou|永州|LLF@Yulin|榆林|UYN@Yuncheng|運(yùn)城|YCU@Zhangjiajie|張家界|DYG@Zhanjiang|湛江|ZHA@Zhaotong|昭通|ZAT@Zhengzhou|鄭州|CGO@zhijiang|芷江|HJJ@Zhongdian|中甸|DIG@Zhoushan|舟山|HSN@Zhuhai|珠海|ZUH@Wuzhou|梧州|WUZ@Eerduosi|鄂爾多斯|DSN@Nalati|那拉提|NLT@"; var varPageId=0; //生成并顯示出城市下拉菜單 function GetCityList(fctThisObj){ var varMenuObj=c$("divAddressMenu"); var varThisObj=fctThisObj; if(varThisObj.id=="menuPageS"||varThisObj.id=="menuPageE"){ varThisObj=varMenuObj.obj; }else{ varPageId=0; } //清除已選城市Value var varThisObjAutoInput=GetValueToInputObj(varThisObj); //取得城市編碼值存儲(chǔ)對(duì)象 if(varThisObjAutoInput)varThisObjAutoInput.value=""; //取得城市數(shù)據(jù)并拆解為數(shù)組 var varObjValue=varThisObj.value; var varThisObjAdd=(varThisObj.getAttributeNode("mod_address_suggest")?varThisObj.getAttributeNode("mod_address_suggest").value:""); var varData=(varObjValue==""?(varThisObjAdd==""?varAddress:varThisObjAdd):varAddress); var varHtmlStr="",varCityDataSplit=varData.split("@"),varCityDataSplitI,varCityDataSplitIu,varNextPageStr=""; //存儲(chǔ)當(dāng)前操作對(duì)象 varMenuObj.obj=varThisObj; var varPageRCount=(varThisObj.getAttributeNode("pagecount")?parseInt(varThisObj.getAttributeNode("pagecount").value,10):18); var varThisPageI=0 for(var i=1;i<varCityDataSplit.length-1;i++){ varCityDataSplitI=varCityDataSplit[i]; if(varCityDataSplitI.toUpperCase().indexOf(varObjValue.toUpperCase())>=0 || varObjValue=="" || i==varObjValue){ // || varCityDataSplitI.toLowerCase().indexOf(varObjValue.toLowerCase())>=0 varThisPageI+=1; if(varThisPageI>varPageId*varPageRCount && varThisPageI<=(varPageId+1)*varPageRCount){ varCityDataSplitISplit=varCityDataSplitI.split("|"); varHtmlStr+="<a href='javascript:;' onclick='WriteCity("+varThisPageI+")' id='menuA"+varThisPageI+"' title='"+varCityDataSplitI+"'><span>"+varCityDataSplitISplit[1]+"("+varCityDataSplitISplit[2]+")</span>"+varCityDataSplitISplit[0]+"</a>"; } } } if(varThisPageI>varPageRCount){ varNextPageStr=" <b id=menuPageS style="+(varPageId>0?"cursor:pointer;":"color:#666666;")+"><<< 上一頁(yè)</b> " varNextPageStr+="<b id=menuPageE style="+(varThisPageI>(varPageId+1)*varPageRCount?"cursor:pointer;":"color:#666666;")+">下一頁(yè) >>></b>"; } var varThisObjPosition=getPosition(varThisObj); //取得事件發(fā)生處控件坐標(biāo) with(varMenuObj){ style.top=varThisObjPosition.top+varThisObjPosition.height+"px"; style.left=varThisObjPosition.left+"px"; style.visibility="visible"; innerHTML="<div><h4>可輸城市拼音/漢字/三字碼。</h4>"+(varHtmlStr==""?"<nobr>沒(méi)有找到您查的信息‘"+varObjValue+"’。</nobr>":varHtmlStr+varNextPageStr)+"</div>"; } GetPyzyIframe("ifm"+varMenuObj.id,"visible",(varThisObjPosition.top+varThisObjPosition.height),varThisObjPosition.left,varMenuObj.offsetWidth,varMenuObj.offsetHeight); //取Iframe return false; } //選擇某城市 function WriteCity(fctI){ var varMenuObj=c$("divAddressMenu"); var varThisObj=varMenuObj.obj; var varMenuValue=$("menuA"+fctI).title; varMenuValue=varMenuValue.split("|"); varThisObj.value=varMenuValue[1]; var varThisObjAutoInput=GetValueToInputObj(varThisObj); //取得城市編碼值存儲(chǔ)對(duì)象 if(!varThisObjAutoInput)varThisObjAutoInput=varThisObj; varThisObjAutoInput.value=varMenuValue[2]; if(typeof(fctI)=="number")AutoNextInputAct(varThisObj,"click"); //_Hidden("1"); } //隱藏城市列表 function _Hidden(e){ e=e?e:event; var varMenuObj=c$("divAddressMenu"); var varThisObj=varMenuObj.obj; if(varMenuObj.style.visibility!="hidden"){ if(e){ var EventOBJ=(e.srcElement?e.srcElement:e.target); if(EventOBJ.id=="menuPageS" && EventOBJ.style.color==""){ //如果點(diǎn)的是“上一頁(yè)”則向上翻頁(yè) varPageId=varPageId-1; GetCityList(EventOBJ); } if(EventOBJ.id=="menuPageE" && EventOBJ.style.color==""){ //如果點(diǎn)的是“下一頁(yè)”則向下翻頁(yè) varPageId=varPageId+1; GetCityList(EventOBJ); } if(varThisObj==EventOBJ || EventOBJ.id.indexOf("menuPage")==0 || EventOBJ.id.indexOf("divAddressMenu")==0) return false; } var varThisObjAutoInput=GetValueToInputObj(varThisObj); //取得城市編碼值存儲(chǔ)對(duì)象 if($("menuA1")){ //如果下拉菜單中存在第一個(gè)城市 if(!varThisObjAutoInput)varThisObjAutoInput=varThisObj; if(varThisObjAutoInput.value=="" || varThisObjAutoInput==varThisObj){ //編碼框中無(wú)值 WriteCity("1"); } }else if(EventOBJ.id.indexOf("menuA")<0){ //如果下拉菜單中不存在滿足條件的城市 if(varThisObj)varThisObj.value=""; } varMenuObj.style.visibility="hidden"; GetPyzyIframe("ifm"+varMenuObj.id,"hidden"); } } /**********城市列表功能 End huzj 2008-4-14*************/ /**********日歷選擇功能 End huzj 2008-4-14*************/ //輸出日歷樣式表 huzj 2008-4-12 document.write('\ <style type="text/css">\ .DateListBox{float:left;border:solid #FC7A7D 1px;width:147px !important;width:142px;height:168px !important;height:176px;font-size:12px;text-align:center;}\ .DateListBox h1{width:100%;background-color:#FFF4F4;color:#B42929;font-size:12px;height:20px;font-weight:bold;line-height:20px;vertical-align:middle;margin:0px;}\ .DateListBox div{float:left;border:solid #EB696C 1px;background-color:#EB696C;color:#FFFFFF;width:19px !important;width:20px;height:20px;font-size:12px;font-weight:bold;line-height:20px;vertical-align:middle;}\ .DateListBox a{float:left;color:#990000;border:solid #ffffff 1px;background-color:#ffffff;width:19px !important;width:20px;height:19px !important;height:22px;font-size:12px;line-height:20px;vertical-align:middle;}\ .DateListBox a:hover{border:solid #F2C2BD 1px;background-color:#FBEDEC;}\ .DateListBox .aSelect{cursor:pointer;border:solid #DEB4B4 1px;background-color:#FAE0CF;color:#FF0000;}\ .PyzyDateBox{position:absolute;z-index:1;visibility:hidden;background-color:#FFFFFF;border:solid #EBcccC 1px;height:170px;width:298px !important;width:286px;}\ </style>\ '); //取得日歷列表,該函數(shù)輸出的內(nèi)容需要根據(jù)需求放置到特定的容器中,如浮動(dòng)層、固定DIV… function GetMonthHTML(fctStaDate,fctDate){ if(!fctDate)fctDate=new Date(); //默認(rèn)為當(dāng)前日期 var varYear=fctDate.getFullYear(); var varMonth=fctDate.getMonth(); var varNextMonth=new Date(varYear,varMonth+1,1); var varThisMonthButDay = new Date(varNextMonth-86400000); //本月最后一天 var varThisDate,varThisWeekDay,varThisMonthHTML=""; varThisMonthHTML+="<h1>"+varYear+"年"+(varMonth+1)+"月</h1>" varThisMonthHTML+="<div>日</div><div>一</div><div>二</div><div>三</div><div>四</div><div>五</div><div>六</div>" for(var DayI=1;DayI<=varThisMonthButDay.getDate();DayI++){ varThisDate=new Date(varYear,varMonth,DayI); varThisWeekDay=varThisDate.getDay(); if(DayI==1){ for(var spcI=0;spcI<varThisWeekDay;spcI++){ varThisMonthHTML+="<a></a>" } } varThisMonthHTML+="<a "+((fctStaDate && fctStaDate!="")?(varThisDate<fctStaDate?"old":""):"")+" href=javascript:; onclick='SelectDate(this)' title='"+varYear+"-"+(varMonth+1)+"-"+DayI+"'>"+DayI+"</a>"; } return '<div class="DateListBox">'+varThisMonthHTML+'</div>'; } //選擇日期 function SelectDate(fctAObj){ if(fctAObj.href||fctAObj.className=="aSelect"){ var varValueObj=$("divPyzyDateBox").Obj; var varValueToObj=GetValueToInputObj(varValueObj); if(varValueToObj)varValueObj=varValueToObj; if(varValueObj.value==fctAObj.title){ varValueObj.value=""; }else{ varValueObj.value=fctAObj.title; } $("divPyzyDateBox").style.visibility="hidden"; $("divPyzyDateBox").bodyclick=""; GetPyzyIframe("ifmdivPyzyDateBox","hidden"); AutoNextInputAct($("divPyzyDateBox").Obj,"click"); } } //隱藏日歷 function HiddenDateBox(){ if($("divPyzyDateBox")){ if($("divPyzyDateBox").style.visibility!="hidden" && $("divPyzyDateBox").bodyclick=="1"){ $("divPyzyDateBox").style.visibility="hidden"; $("divPyzyDateBox").bodyclick=""; GetPyzyIframe("ifmdivPyzyDateBox","hidden"); }else{ $("divPyzyDateBox").bodyclick="1"; } } } //顯示日歷 function ShowTwoMonthList(fctThisObj,fctJNum,fctStaDate){ if(!fctJNum)fctJNum=0; if(!fctThisObj)fctThisObj=""; var varStaDate=null,varTheDate=new Date(); if(fctStaDate||fctStaDate==""){ varStaDate=new Date(new Date()-86400000); //如果沒(méi)有定義具體可使用的開(kāi)始時(shí)間則自定義為今天 var varStaDateSplit=fctStaDate.split("-"); if(varStaDateSplit.length==3){ varStaDate=new Date(varStaDateSplit[0],parseInt(varStaDateSplit[1],10)-1,varStaDateSplit[2]);//fctStaDate=new Date(); } varTheDate=varStaDate; if(fctStaDate=="")fctStaDate=varStaDate.getFullYear()+"-"+(varStaDate.getMonth()+1)+"-"+varStaDate.getDate(); } var varShowTwoMonthHTML=""; for(var i=0+fctJNum;i<2+fctJNum;i++){ varShowTwoMonthHTML+=GetMonthHTML((varStaDate?varStaDate:""),new Date(varTheDate.getFullYear(),varTheDate.getMonth()+i,1)); } if(varStaDate)varShowTwoMonthHTML=varShowTwoMonthHTML.replace(/old href/g,"style=color:#999 old"); if(fctThisObj.value!=""){ //對(duì)已選日期樣式進(jìn)行改變 if(/^((\d{4})|(\d{2}))-(\d{1,2})-(\d{1,2})$/g.test(fctThisObj.value))varShowTwoMonthHTML=varShowTwoMonthHTML.replace(fctThisObj.value,fctThisObj.value+"' class='aSelect"); } var varDateBoxObj = c$("divPyzyDateBox","PyzyDateBox"); varDateBoxObj.bodyclick=""; if(fctThisObj!=""){ //調(diào)整坐標(biāo)到合適位置 var varThisObjPosition=getPosition(fctThisObj); varDateBoxObj.style.top=(varThisObjPosition.top+varThisObjPosition.height)+"px"; varDateBoxObj.style.left=varThisObjPosition.left+"px"; varDateBoxObj.style.visibility="visible"; //hidden varDateBoxObj.Obj=fctThisObj; } varDateBoxObj.innerHTML=varShowTwoMonthHTML+'<div style="margin-top:'+(document.all?'-177':'-1')+'px;color:#B42929;font-size:12px;font-weight:bold;line-height:24px;vertical-align:bottom;"> <span style="padding-right:'+(document.all?'220':'232')+'px;cursor:pointer;" onclick="ShowTwoMonthList(null,'+(fctJNum-1)+(fctStaDate?',\''+fctStaDate+'\'':'')+')" title="上月"><--</span><span style="cursor:pointer;" onclick="ShowTwoMonthList(null,'+(fctJNum+1)+(fctStaDate?',\''+fctStaDate+'\'':'')+')" title="下月">--></span></div>'; GetPyzyIframe("ifmdivPyzyDateBox","visible",(varThisObjPosition.top+varThisObjPosition.height),varThisObjPosition.left,varDateBoxObj.offsetWidth,varDateBoxObj.offsetHeight); //取Iframe } /**********日歷選擇功能 End huzj 2008-4-14*************/ //為window.onload增加一個(gè)為document增加onclick處理函數(shù)的函數(shù)(^_^)huzj 2008-4-14 AddFunToObj(window,"onload","AddFunToObj(document,'onclick','_Hidden("+(document.all?"":"e")+");HiddenDateBox();');"); </script> </head> <body> 已通過(guò)測(cè)試的瀏覽器:IE6、IE7、FF <div style=" border:solid #999999 1px;background-color:#FFFCE6;padding:10px; margin:20px;"> 編碼存儲(chǔ)域:<input name="cityCode" id="cityCode" value=""/> <br /> 城市1:<input name="dest_city_1" id="dest_city_1" type="text" value="" size="10" onclick="GetCityList(this)" onkeyup="GetCityList(this)" value_to_input="cityCode" nextinput="dest_city_2" mod_address_suggest="@Xian|西安|SIA@Beijing|北京|BJS@Shanghai|上海|SHA@Shenzhen|深圳|SZX@Guangzhou|廣州|CAN@Qingdao|青島|TAO@Chengdu|成都|CTU@Hangzhou|杭州|HGH@Wuhan|武漢|WUH@Tianjin|天津|TSN@Dalian|大連|DLC@Xiamen|廈門(mén)|XMN@Chongqing|重慶|CKG@" />有指定默認(rèn)城市列表,選擇完成后自動(dòng)跳轉(zhuǎn)到下一城市選擇對(duì)象 <br /> 城市2:<input name="dest_city_2" id="dest_city_2" type="text" value="" size="10" onclick="GetCityList(this)" onkeyup="GetCityList(this)" pagecount="5" />未指定默認(rèn)城市列表,未指定城市值存儲(chǔ)域,設(shè)置了每頁(yè)顯示城市數(shù)量為5個(gè) <div id="div1" style="border:solid #003399 1px;"></div> <br /> <br /> 日期1:<input type="text" name="textfield1" id="textfield1" nextinput="textfield2" onClick="ShowTwoMonthList(this,0,'thisDay');" value=""/> 當(dāng)前日期為最后可用日期,該項(xiàng)選擇完成后自動(dòng)跳轉(zhuǎn)到下一日期項(xiàng)<br /> 日期2:<input type="text" name="textfield2" id="textfield2" nextinput="textfield3" onClick="ShowTwoMonthList(this,0,$('textfield1').value);"/> 上一關(guān)聯(lián)日期為最終可用日期 <br /> 日期3:<input type="text" name="textfield3" id="textfield3" onClick="ShowTwoMonthList(this,0);"/> 無(wú)任何限制,所有日期均可用<br /> 日期4:<input type="text" name="textfield4" id="textfield4" /><input style="background-color:#EBCCCC; border-width:0px;" type="button" name="btn" value="選擇日期" value_to_input="textfield4" onClick="ShowTwoMonthList(this,0);"/> 點(diǎn)相關(guān)圖標(biāo)或按鈕選擇日期 <br /> 測(cè)試覆蓋:<select name="select"><option>測(cè)試層是否能蓋住下拉菜單</option></select> <br /> 在日歷中點(diǎn)擊已選日期,自動(dòng)切換取消選擇。 </div> </body>
提示:您可以先修改部分代碼再運(yùn)行
posted on 2008-05-26 15:36
farmer
閱讀(419)
評(píng)論(1)
編輯
收藏
評(píng)論:
#
re: 城市、日歷選擇,含輸入提示功能,非常酷的效果
2012-07-04 10:36 |
北夜人
很好的js效果,支持一下,看完有問(wèn)題再請(qǐng)教樓主
回復(fù)
更多評(píng)論
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問(wèn)
管理
斯是陋室,惟吾德馨
歡迎訪問(wèn):
茅草窩
<
2012年7月
>
日
一
二
三
四
五
六
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
常用鏈接
我的隨筆
我的文章
我的評(píng)論
我的參與
最新評(píng)論
留言簿
(1)
給我留言
查看公開(kāi)留言
查看私人留言
隨筆檔案
2008年3月 (1)
文章檔案
2010年7月 (2)
2010年4月 (1)
2009年10月 (1)
2009年6月 (1)
2008年9月 (1)
2008年8月 (1)
2008年5月 (8)
Friend Link
茅草窩
搜索
積分與排名
積分 - 4321
排名 - 3241
最新評(píng)論
1.?re: 城市、日歷選擇,含輸入提示功能,非常酷的效果
很好的js效果,支持一下,看完有問(wèn)題再請(qǐng)教樓主
--北夜人
2.?re: C#操作Excel文件
這個(gè)函數(shù)在那個(gè)庫(kù)中,按要求添加庫(kù)了,怎么解決
--kylexy
3.?re: C#操作Excel文件
評(píng)論內(nèi)容較長(zhǎng),點(diǎn)擊標(biāo)題查看
--kylexy
4.?re: 獲取SQL所有數(shù)據(jù)庫(kù)名、所有表名、所有字段名[未登錄](méi)
yes thank you
--frist
Powered by:
博客園
模板提供:
滬江博客
Copyright ©2025 farmer
主站蜘蛛池模板:
栾城县
|
从化市
|
凭祥市
|
牡丹江市
|
锡林郭勒盟
|
宁国市
|
洪雅县
|
彭水
|
故城县
|
北宁市
|
鄂尔多斯市
|
沅陵县
|
盐池县
|
西乡县
|
云阳县
|
平舆县
|
莲花县
|
焉耆
|
布尔津县
|
吕梁市
|
米脂县
|
大冶市
|
南皮县
|
盐亭县
|
启东市
|
旬邑县
|
乌兰察布市
|
武定县
|
卓资县
|
曲水县
|
乐平市
|
广安市
|
吕梁市
|
汶上县
|
钟山县
|
阿坝县
|
格尔木市
|
阜康市
|
黄骅市
|
辽宁省
|
阿拉善左旗
|