js代码
/**
* 默认调用
*/
!function () {
var $target = $('#J_Address');
$target.citySelect();
$target.on('click', function (event) {
event.stopPropagation();
$target.citySelect('open');
});
$target.on('done.ydui.cityselect', function (ret) {
$(this).val(ret.provance + ' ' + ret.city + ' ' + ret.area);
});
}();
/**
* 设置默认值
*/
!function () {
var $target = $('#J_Address2');
$target.citySelect({
provance: '新疆',
city: '乌鲁木齐市',
area: '天山区'
});
$target.on('click', function (event) {
event.stopPropagation();
$target.citySelect('open');
});
$target.on('done.ydui.cityselect', function (ret) {
$(this).val(ret.provance + ' ' + ret.city + ' ' + ret.area);
});
}();