JQuery 输入城市 提示(445个)

<style><!--
            #suggest{opacity: 0.9;}
            .gray{color:gray;}
            .ac_results {background:#fff;border:1px solid #7f9db9;position:absolute;z-index:10000;display:none;}
            .ac_results ul{margin:0;padding:0;list-style:none;}
            .ac_results li a{white-space:nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px;}
            .ac_results li{border:1px solid #fff;}
            .ac_over,.ac_results li a:hover {background:#c8e3fc;}
            .ac_results li a span{float:right;} 
            .ac_result_tip{border-bottom:1px dashed #666;padding:3px;}
        
--></style>
<p><input id="arrcity" type="text" name="city" /></p>
<div id="suggest" class="ac_results">&nbsp;</div>
<script type="text/javascript" src="http://www.cnblogs.com/Js/city/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="http://www.cnblogs.com/Js/city/j.suggest.js"></script>
<script type="text/javascript" src="http://www.cnblogs.com/Js/city/j.dimensions.js"></script>
<script type="text/javascript" src="http://www.cnblogs.com/Js/city/aircity.js"></script>
<script type="text/javascript">// <![CDATA[
$(function(){
    $("#suggest").width($(".form-group").width());
    $("#arrcity").suggest(citys,{hot_list:commoncitys,dataContainer:'#arrcity_3word',onSelect:function(){$("#city2").click();},attachObject:'#suggest'});
});
// ]]></script>

 

 

js 文件 https://files.cnblogs.com/files/yutaoyao/city.rar

 

效果

posted on 2015-05-22 15:03  一条大鱼  阅读(243)  评论(0编辑  收藏  举报