DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> WEB網站前端 >> 網頁特效代碼 >> 使用js實現極速選擇輸入城市名
使用js實現極速選擇輸入城市名
編輯:網頁特效代碼     
如果開發中遇到需要輸入城市名的頁面,那麼這個特效可以幫助快速輸入。這是一個純js實現的效果,可以快速的輸入城市名稱,支持鼠標點擊選擇,輸入城市的拼音或者拼音首字母,使用方便。可以在輸入框中通過點擊生成包含中國各個城市的下拉列表,進行快速選擇,快速切換定位。

體驗效果:
http://hovertree.com/texiao/js/36/

HTML文件代碼如下:
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>js中國各大城市快速選擇代碼 - 何問起</title>
<link rel="stylesheet" href="http://hovertree.com/texiao/js/36/css/cityselect.css">
<style type="text/css">
.demo{width:220px;margin:50px auto;}
.demo input{padding: 12px 18px;}
a{color:deepskyblue;}
</style>
</head>
<body>
<h3 style="text-align: center;margin-top: 15px;">在下面的輸入框中輸入城市的名稱:</h3>
<div class="demo">
<!-- 在輸入框加入id -->
<input type="text" class="cityinput" id="citySelect" placeholder="請輸入目的地">
</div>

<script type="text/javascript" src="http://hovertree.com/texiao/js/36/js/cityselect.js"></script>
<script type="text/javascript">
var hovertree=new Vcity.CitySelector({input:'citySelect'});
</script>

<div style="text-align:center;margin:150px 0; font:normal 14px/24px 'MicroSoft YaHei';">

<p>來源:<a href="http://hovertree.com/" target="_blank">何問起</a> <a href="http://hovertree.com/h/bjag/l9bv36jh.htm" target="_blank">說明</a></p>
</div>
</body>
</html>
源碼下載:
http://hovertree.com/h/bjag/qd1jxjuh.htm
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved