36 Unstar Star 107 Fork 39

RockYang / JAreaSelect-js省市区级联选择插件

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
index.html 1.85 KB
Copy Edit Web IDE Raw Blame History
RockYang authored 2018-10-24 17:31 . use local assets file replace to cdn
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="assets/bootstrap.min.css">
<title>地区选择插件</title>
<script type="text/javascript" src="assets/jquery.min.js"></script>
<script type="text/javascript" src="src/JAreaData.js"></script>
<script type="text/javascript" src="src/JAreaSelect.js"></script>
<script type="text/javascript" src="src/JAreaSelect2.js"></script>
<style type="text/css">
.form-control {
margin-right: 5px;
}
</style>
</head>
<body>
<div class="container" style="padding-top: 20px;">
<div class="alert alert-success" role="alert">
<strong>传统表单 select UI 样式</strong>
</div>
<div id="area-select-box" class="form-inline"></div>
<p><button class="btn btn-success" style="margin: 10px 0px;">获取地址</button></p>
<div class="alert alert-danger" role="alert">
<strong>仿京东 UI 样式</strong>
</div>
<p><button class="btn btn-danger">选择区域</button></p>
<div id="area-select-box2"></div>
</div>
</body>
<script type="text/javascript">
var area = $("#area-select-box").JAreaSelect({
prov : 1,
city : 72,
dist : 2839,
level : 3
});
$(".btn-success").on('click', function() {
$(this).text(area.getAreaString());
});
$(".btn-danger").on("click", function() {
$("#area-select-box2").JAreaSelect2({
prov : 1,
city : 72,
dist : 2839,
callback : function(data) {
console.log(data);
$(".btn-danger").html(data.address);
}
});
});
</script>
</html>

Comment ( 0 )

Sign in for post a comment

JavaScript
1
https://git.oschina.net/blackfox/JAreaSelect.git
git@git.oschina.net:blackfox/JAreaSelect.git
blackfox
JAreaSelect
JAreaSelect-js省市区级联选择插件
master

Search

132457 8cb2edc1 1899542 131848 70c8d3a4 1899542