代码使用示例:
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0″><title>Mobiscroll</title>
<script src=”js/jquery.min.js”></script><script src=”js/mobiscroll.custom-2.6.2.min.js”></script>
<link rel=”stylesheet” type=”text/css” href=”css/mobiscroll.custom-2.6.2.min.css”>
</head><body>
<div >
<label for=”txtBirthday”>出生日期:</label>
<input type=”text” id=”txtBirthday” name=”birthday” />
</div>
<script>
$(function () {
var opt = {
theme: “android-ics light”,
display: ‘modal’, //显示方式
lang: “zh”,
setText: ‘确定’, //确认按钮名称
cancelText: “取消”,
dateFormat: ‘yyyy-mm-dd’, //返回结果格式化为年月格式
dateOrder: ‘yyyymmdd’, //面板中日期排列格式
onBeforeShow: function (inst) {
// console.info( inst.settings.wheels);
},
headerText: function (valueText) { //自定义弹出框头部格式
// console.info(valueText);
array = valueText.split(‘-‘);
return array[0] + “年” + array[1] + “月” + array[2] + “日”;
}
};$(“#txtBirthday”).mobiscroll().date(opt);
});
</script>
</body></<html>
示例下载:
转载请注明:苏demo的别样人生 » Mobiscroll 生日选择控件