Jquery mobile 1.4 data-enhance = false不起作用 [英] Jquery mobile 1.4 data-enhance=false don't work

查看:58
本文介绍了Jquery mobile 1.4 data-enhance = false不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的JQM应用程序从1.3更新到1.4,并且在某些元素上,data-enhance =false不再起作用...元素仍然增强...

I'm trying to update my JQM app from 1.3 to 1.4, and on some element, data-enhance="false" doesn't work anymore… The elements remains enhanced…

jsfiddle: http://jsfiddle.net/matthieubrunet/RB9Qw/

jsfiddle : http://jsfiddle.net/matthieubrunet/RB9Qw/

<div data-role="page" id="home">
    <div data-role="header">
         <h1>JQM 1.4.3</h1>
    </div>
    <div data-role="content">
        <label for="yes">Yes</label>
        <input type="checkbox" name="yes" id="yes" data-enhance="false" />
    </div>
</div>

我试图激活ignoreContentEnabled选项,但它不起作用:

I tried to activate the ignoreContentEnabled option, but it doesn't work :

$( document ).on( "mobileinit", function() {
  $.mobile.ignoreContentEnabled = true;
});

这是一个错误,还是我错过了什么?

Is it a bug, or am I missing something ?

非常感谢你的帮助。

推荐答案

把你的脚本

$( document ).on( "mobileinit", function() {
  $.mobile.ignoreContentEnabled = true;
});

。官方文档声明,一旦jquery mobile js被加载,就会调用mobileinit: http://api.jquerymobile。 com / global-config /

just before loading jquery mobile js. official docs state that mobileinit gets called as soon as jquery mobile js gets loaded : http://api.jquerymobile.com/global-config/

因此订单应为:

jquery.js - > mobileinit binding script-> jquery.mobile.js

jquery.js -> mobileinit binding script-> jquery.mobile.js

这篇关于Jquery mobile 1.4 data-enhance = false不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆