jQuery TWzipcode 台灣縣市區和郵遞區號下拉選單
| jQuery TWzipcode 縣市區域選單 |
使用方法:
第一步 首先載入 jQuery TWzipcode 需要用到的 JavaScript 檔
<!-- 使用 Google AJAX API 取得 jQuery 框架 1.8.2 min 版本 -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<!-- 載入 Zebra_Cookie 的主程式碼 -->
<script type="text/javascript" src="jquery.twzipcode-1.4.1-min.js"></script>
第二步 畫出 HTML 顯示選擇器的範圍
<div id="container"></div>第三步 使用 JavaScript 讓 jQuery TWzipcode 初始化 需先載入 Google Maps API
$(function () {
$('#container').twzipcode({
detect: true // 偵測位置
});
});
jQuery TWzipcode 參數
| 名稱 | 類型 | 說明 |
|---|---|---|
| detect | Boolean | 是否偵測用戶位置 預設 false, 此功能提供的數據並非絕對正確,僅供參考 |
| countyName | String | 指定縣市下拉清單的表單名稱 預設 county |
| districtName | String | 指定鄉鎮市區下拉清單的表單名稱 預設 district |
| zipcodeName | String | 指定郵遞區號輸入框的表單名稱 預設 zipcode |
| countySel | String | 縣市預設值 |
| districtSel | String | 鄉鎮市區預設值 |
| zipcodeSel | String | 郵遞區號預設值 |
| readonly | Boolean | 郵遞區號輸入框是否唯讀?預設 true |
| css | Array | 表單元件樣式名稱 格式: ['縣市', '鄉鎮市區', '郵遞區號'] |
jQuery TWzipcode 方法
| 方法 | 說明 |
|---|---|
| destory | 從指定的元素移除 Plugin: $(selector).twzipcode('destory'); |
| reset | 將指定的元素恢復未選狀態: $(selector).twzipcode('reset'); |
| serialize | 將指定的元素輸出為 URL Query: $(selector).twzipcode('serialize'); |
檔案大小:13 KB
檔案下載:http://app.essoduke.org/twzipcode/twzipcode-1.4.1-min.js
0 意見