我有这个功能来更新时间:
updateTimerView: function(hours, minutes, seconds){
var inst = $('#scroller').mobiscroll('getInst');
inst.temp = [hours, minutes, seconds];
}
但我总是收到错误:TypeError: inst is undefined
如果我将 inst 作为参数传递,同样的函数也可以工作,例如使用 onBeforeShow: function (dw, inst) 检索 inst。因此,为了清楚起见,这有效:
updateTimerView: function(inst, hours, minutes, seconds){
inst.temp = [hours, minutes, seconds];
}
这里也没有列出 getInst 方法:但这里说这是获取滚动条实例的一种方法。
任何想法?