gpt4 book ai didi

jQuery 升级 - jquery.mobile 添加类

转载 作者:行者123 更新时间:2023-12-01 07:40:11 27 4
gpt4 key购买 nike

我们目前正在将 jQuery 版本从 1.10 升级到 3.3.1

因此,我们还必须安装 jquery.mobile v1.5.0(因为这是唯一与 v3 兼容的版本)

jquery.mobile 正在向我的页面添加类以及其他 div 元素(例如 data-role="page")

有没有办法阻止 jquery.mobile 执行此操作/禁用它。我的页面布局正在受到这些新类的影响

最佳答案

mobileinit 上禁用 jQM 的 $.mobile.autoInitializePage

<head>
<!-- jQuery.js here -->
<script>
$(document).on("mobileinit", function () {
$.mobile.autoInitializePage = false;
});
</script>
<!-- jQuery Mobile.js here -->
</head>

要手动初始化框架,请使用$.mobile.initializePage();

关于jQuery 升级 - jquery.mobile 添加类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51437555/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com