<!DOCTYPE html PUBLIC "-//W3C//DTDXHTML 1.0 Transitional//EN" "http://www.shaxiangift.com/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.yx67.com/1999/xhtml">
<head>
<metahttp-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>jQuery城市選擇單選多選代碼</title>
<linkhref="css/hsCheckData.css" rel="stylesheet" />
<style>
#demo{
margin:0auto;
margin-top:100px;
width:700px;
}
</style>
</head>
<body>
<div id="demo">
<span>單選</span>
<divid="cityDanXuan" style="width:300px;">
</div>
<br/>
<br/>
<br/>
<span>多選</span>
<divid="cityDuoXuan" style="width:300px;">
</div>
<br/>
<br/>
<br/>
<span>默認值</span>
<divid="cityMR" style="width:300px;"data-id="11-12-1301">
</div>
</div>
<scriptsrc="js/jquery.min.js"></script>
<scriptsrc="js/cityData.js"></script>
<scriptsrc="js/hsCheckData.js"></script>
<script>
$('#cityDanXuan').hsCheckData({
isShowCheckBox:false, //默認為false
data:cityData
});
$('#cityDuoXuan').hsCheckData({
isShowCheckBox:true, //默認為false
minCheck:3,//默認為0,不限最少選擇個數(shù)
maxCheck:6,//默認為0,不限最多選擇個數(shù)
data:cityData
});
$('#cityMR').hsCheckData({
isShowCheckBox:true,
data:cityData
});
</script>
<divstyle="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoftYaHei';">
<p>適用瀏覽器:360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗. 不支持IE8及以下瀏覽器。</p>
<p>來源:<a > </a></p>
</div>
</body>
</html>
聯(lián)系客服