作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何使用 mobiscroll 调用 onBeforeShow 事件?
$('#starttime').mobiscroll('setValue', value).time({
theme: 'jqm',
display: 'modal',
mode: 'clickpick',
stepMinute: 10,
onBeforeShow:
});
我需要在它显示之前设置时间。如果我尝试在文档准备好时执行此操作,则输入字段尚未准备好值...
编辑
我尝试过:
$('#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');
}
});
但随后我收到错误:“值未定义”...
最佳答案
您必须提供回调函数。
$('#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
}
});
关于javascript - Mobiscroll onBeforeShow,设置值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14289475/
如何使用 mobiscroll 调用 onBeforeShow 事件? $('#starttime').mobiscroll('setValue', value).time({ the
我正在使用 Angular 带弹出框。 http://mgcrea.github.io/angular-strap/#/popovers 文档说,如果提供了 onBeforeShow 函数,则应在显示
请告诉我有关使用 Angular-strap Popover 库的 onBeforeShow() 事件应用 CSS(left) 样式的信息。 基本上,我想将弹出窗口的左侧位置减少 50-100 像素,
我是一名优秀的程序员,十分优秀!