如何使用mobiscroll调用onBeforeShow事件?
$('#starttime').mobiscroll('setValue', value).time({
theme: 'jqm',
display: 'modal',
mode: 'clickpick',
stepMinute: 10,
onBeforeShow:
});我需要在它出现之前把时间设定好。如果我试图在document上完成它,输入字段还没有准备好,而值是.
编辑
我试过:
$('#starttime').mobiscroll('setValue', value).time({
theme: 'jqm',
display: 'modal',
mode: 'clickpick',
stepMinute: 10,
onBeforeShow: function(html, inst) {
start = $('#starttime').val();
var a = moment();
var value = a.format('h:mm A');
}
});但是我得到了一个错误:“值没有定义”.
发布于 2013-01-12 02:31:44
您必须提供一个回调函数。
$('#starttime').mobiscroll('setValue', value).time({
theme: 'jqm',
display: 'modal',
mode: 'clickpick',
stepMinute: 10,
onBeforeShow: function (html, inst) {
//Gets called before the scroller appears. The function receives the jQuery object containing the generated html and the scroller instance as parameters
}
});http://docs.mobiscroll.com/23/mobiscroll-core
https://stackoverflow.com/questions/14289475
复制相似问题