资源描述:
《php+ajax做仿百度搜索下拉自动提示框》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、代码如下:0){$sql="SELECTvalueFROMcountriesWHEREvalueLIKE'".$queryString."%'LIMIT10";$query=mysql_query($sql);while($result=mysql_fetch_array($query,MYSQL_BO
2、TH)){$value=$result['value'];echo''.$value.'';}}?>index.htm文件复制代码代码如下:3、http-equiv="Content-Type"content="text/html;charset=utf-8"/>
AjaxAutoSuggestfunctionlookup(inputString){if(inputString.length==0){//Hidet
4、hesuggestionbox.$('#suggestions').hide();}else{$.post("rpc.php",{queryString:""+inputString+""},function(data){if(data.length>0){$('#suggestions').show();$('#autoSuggestionsList').html(data);}});}}//lookupfunctionfill(thisValue){$('#inputString').val(thisValue);setTimeout("$('
5、#suggestions').hide();",200);}body{font-family:Helvetica;font-size:11px;color:#000;}h3{margin:0px;padding:0px;}.suggestionsBox{position:relative;left:30px;margin:10px0px0px0px;width:200px;background-color:#212427;-moz-border-radius:7px;-webkit-bo
6、rder-radius:7px;border:2pxsolid#000;color:#fff;}.suggestionList{margin:0px;padding:0px;}.suggestionListli{margin:0px0px3px0px;padding:3px;cursor:pointer;}.suggestionListli:hover{background-color:#659CD8;}