你说的是 百度首页的那个 ajax效果?那个东西模拟起来要用到的东西很多  不是 几句代码就能搞定的

解决方案 »

  1.   

    对 就是 模拟 百度首页 搜索 的时候 出现的 下拉提示 功能。要求三联。好像 javascript 也可以实现?
      

  2.   

    那就用ajax 吧。万能的高手啊,帮帮忙吧~!
      

  3.   

    你说的是这个suggest功能吧  现在出来对应的模块了 看一下演示效果http://www.never-online.net/code/neverModules/autocomplete/sugguest.html
    下载地址http://www.never-online.net/code/neverModules/autocomplete/
    简要说明:http://bbs.okajax.com/viewthread.php?tid=1874&page=1
      

  4.   

     <div id="showDictionary" style="display:none;width:330px;"> <div id="dictionary">

                                    
                              
    </div>
    <div id="dictionaryPage">
                                      <a onclick="$('#showDictionary').hide();">关闭</a>
                                </div>
    </div>$(function() {
    $("#create-new-community").click(onCreateNewFloor_Click);
    });
    function onCreateNewFloor_Click() {
    newFloor('newfloors','NewCommunity.asp','新建小区');
    return false;
    }function newFloor(id,url,title) {
    var Community = $("#Community").val();
    Community = Community.replace("·", "-");
    $.plugins.showDialog("newfloors",title,url + '?Community=' + Community, 350,200);
    }function dialog_close() {
    $.plugins.closeDialog("newfloors");
    }/*-= ajax选择小区 -=*/$(function(){var _ajaxFloorList = function(explorer){
    if (explorer != "") {
    getAjaxList(explorer)
    //getAjaxListPage(explorer, 1)
    }
    $("#showDictionary").show();
    }; //小区选择

    var xq_func = function() {
    _ajaxFloorList(this.value);
    };

    $("#Community").bind("propertychange", xq_func).bind("input",xq_func);

    })

    //ajax select community


    function getAjaxList(explorer) {
           $.get("Community_Dictionary.asp?KeyWords="+explorer,
    null,
    function(data){
    var dictionaryData = "";
    if (data.length>0) {
    var json = eval('('+data+')');
        var jsonLength = json.list.length;     
    dictionaryData = "<div style='margin-bottom:10px;background-color:#d6efac;line-height:28px;padding-left:20px;height:28px'><img src='../image/xz_tb.gif'/><font color=green><b>选择小区</b></font>(如下列表中不存在,点此<a id='create-new-community' href='javascript:void(0)'><font color=red>+新建小区</font></a>)</div><div id='box'>";
    for ( var i = 0; i < json.list.length; i++) {
    var Community_ID = json.list[i].Community_ID;
    var Community = json.list[i].Community;
    var Address = json.list[i].Address;
    if (Address == "null")
    Address = "";
    var Area_ID = json.list[i].Area_ID;
    dictionaryData = dictionaryData

    + "<div style='height:22px;line-height:29px;padding-left:40px;overflow:hidden;'><img src='../image/sjy_x.gif'/><a  class='item' href=\"javascript:;\" onClick=\"javascript:selectFloor("
    + "'" + Community_ID + "'," + "'" + Community
    + "','" + Address + "','" + Area_ID + "');\"><font color=#ff6200>"
    + Community + "</font></a><font color=#565e53> " + Address
    + "</font></div>";
    }
    //dictionaryData += "<a id='create-new-floor' href='javascript:void(0)'>列表中不存在,<span style='color:red;font-size:16px;'>点此</span>新建小区</a>";
    } else {
    dictionaryData += "<a id='create-new-community' href='javascript:void(0)' style='display:block;margin:6px 0 0 6px;'>列表中不存在,<span style='color:red;font-size:16px;'>点此</span>新建小区</a>";
    }
    dictionaryData +="</div>"
    $("#dictionary").html(dictionaryData);
    if($("#box").height()>200){
        $("#box").css("height","200px");
    $("#box").css("overflow-y","scroll");
    }
    $("#create-new-community").click(onCreateNewFloor_Click);
    }, "text");
    }
    function selectFloor(Community_ID,Community,Address,Area_ID) {
    $("#Community_ID").val(Community_ID);
    $("#Community").val(Community);
    //$("#Address").val(Address);
    //$("#Area_ID").val(Area_ID);
    $("#showDictionary").hide();
    }
      

  5.   

    这是那个效果  客户端代码服务器端要返回  json 格式数据