一旦页面加载完成jQuery Mobile
,微调器就会消失。我希望微调器一直停留到某些事件(来自服务器的数据到达)之后:
$('#form').live('pagebeforeshow', function(){
var def = $.Deferred();
$.post('url', obj)
.success(function (response) {
def.resolve();
});
def.done(function(){
// I want the spinner to disappear now.
});
});
// in this point, once the 'pagebeforeshow' handler is returned,
// the spinner disappears - but I want it to stay only after def is resolved.
(顺便说一句,我想找到微调器被移除的点会更简单,然后重新显示它。我希望找到一个更优雅的解决方案,不会有这种风险(虽然风险很小,但仍然..)有那种闪烁)