怎么禁用jq mobile自带的css样式

兔子饿了 2015-10-13 03:58:39
jq mobile会初始化dom好烦啊,加了一堆class还有不想要的样式。
翻了翻源码,只找到这些

//dom-ready inits
if ( $.mobile.autoInitializePage ) {
$.mobile.initializePage();
}

//automatically initialize the DOM when it's ready
autoInitializePage: true,

//remove initial build class (only present on first pageshow)
function hideRenderingClass() {
$html.removeClass( "ui-mobile-rendering" );
}

// Add mobile, initial load "rendering" classes to docEl
$html.addClass( "ui-mobile ui-mobile-rendering" );

// This is a fallback. If anything goes wrong (JS errors, etc), or events don't fire,
// this ensures the rendering class is removed after 5 seconds, so content is visible and accessible
setTimeout( hideRenderingClass, 5000 );

我想到的办法是禁用初始化dom,这时html会被加上有dispaly:none;的class,五秒后去除class,
于是不等定时器完毕直接把html的class去掉

$.mobile.autoInitializePage = false;
$("html").removeAttr("class");

现在是没问题了,但不不知道这个方法会不会引起其他问题,求大神解惑。
...全文
193 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
兔子饿了 2015-10-13
  • 打赏
  • 举报
回复
就没有大神来指点下么

87,955

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧