jquery - jQuery升级——jquery.mobile添加类
问题描述
我们目前正在将我们的 jQuery 版本从 1.10 升级到 3.3.1
结果,我们还必须安装 jquery.mobile v1.5.0(因为这是唯一与 v3 兼容的)
jquery.mobile 正在向我的页面添加类以及其他 div 元素(data-role="page"
例如)
有没有办法阻止 jquery.mobile 这样做/禁用它。我的页面布局受到这些新类的影响
解决方案
禁用 jQM$.mobile.autoInitializePage
的mobileinit
.
<head>
<!-- jQuery.js here -->
<script>
$(document).on("mobileinit", function () {
$.mobile.autoInitializePage = false;
});
</script>
<!-- jQuery Mobile.js here -->
</head>
要手动初始化框架,请使用$.mobile.initializePage();
.
推荐阅读
- python - if __name__ == '__main__' 的作用是什么?
- javascript - 按id删除数组中的多个对象
- scala - from_json 未在 spark 结构化流中将 json 转换为 DF
- amazon-web-services - AWS Lambda 和 Amazon S3 资源是否可以存在于同一个 CloudFormation 模板中?
- java - 尝试从 gitlab 检索配置信息时获取“无效的 cookie 标头:“Set-Cookie:experimentation_subject_id ...”
- ubuntu - Visual Studio Code - 在 linux 中禁用更新检查
- loops - 到第 28 天结束时,会有多少只绿蝇?请检查程序是否是正确的解决方案
- javascript - 无法使用获取的数据根据输入值进行搜索。收到过滤器错误
- pandas - 如何在 dask 中编写 unstack 和 reindex?
- ios - QML 更改 iPhone 凹槽和底部区域的颜色