use*_*567 6 javascript jquery html5 css3 jquery-mobile
我正在使用jquery mobile.我只是想阻止jquery mobile做任何事情,除非我明确地调用trigger('create')方法.有没有办法停止jquery移动自动初始化一段时间.
你可以通过添加这个属性来做到这一点:
data-enhance="false"
Run Code Online (Sandbox Code Playgroud)到一个通缉的容器.
而且你还需要在app加载阶段打开它:
$(document).one("mobileinit", function () {
$.mobile.ignoreContentEnabled=true;
});
Run Code Online (Sandbox Code Playgroud)
有关这方面的更多信息,请访问:
http://jquerymobile.com/test/docs/pages/page-scripting.html
例:
http://jsfiddle.net/Gajotres/Xjurd/
您可以通过启用/禁用$ .mobile.ignoreContentEnabled = true来测试它;
第二个选项是使用此行手动执行:
data-role="none"
Run Code Online (Sandbox Code Playgroud)例:
http://jsfiddle.net/Gajotres/LqDke/
编辑:
要再次重新创建页面,请使用以下命令:
$('#index').live('pagebeforeshow', function (event) {
$.mobile.ignoreContentEnabled = false;
$(this).attr('data-enhance','true');
$(this).trigger("pagecreate")
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1770 次 |
| 最近记录: |