尝试使用jquery,Framework7和mobipick实现自定义日期选择器。
使用Html文件中的以下文件:
<head>
<link rel="stylesheet" href="../css/framework7.css">
<link href="../css/mobipick.css" rel="stylesheet">
<script type="text/javascript" src="../js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="../js/xdate.js"></script>
<script type="text/javascript" src="../js/xdate.i18n.js"></script>
<script type="text/javascript" src="../js/mobipick.js"></script>
<script type="text/javascript" src="../js/framework7.js"></script>
</head>
<body>
<input id="r_dob" type="text" ></input>
</body>
并在Js文件中:
jQuery(function($){
alert('Picker');
var picker = $( "input[type='text']", this );
//var picker = $( "#r_dob" );
picker.mobipick({});
picker.bind( "change", function() {
var date = $( this ).val();
// formatted date
var dateObject = $( this ).mobipick( "option", "date" );
});
});
在此picker.mobipick({}); that object has no method mobipick
获取错误。
请帮助。