Modernizr .load() 解决 jquerymobile 滞后问题
我正在尝试使用 Modernizr.js 来使用媒体查询“mq()”并加载“.load()”以根据媒体查询结果加载 jquerymobile 版本的网站,我遇到了以下问题 safari 中的.load() 函数
测试,某些东西导致了很大的延迟,在所有内容之后加载资源 在指向modernizr.js之后,我已经尝试过
<script type="text/javascript" >
Modernizr.load('js/jqm-b2.js');
</script>
并尝试过这
Modernizr.load([
{
test : Modernizr.mq('only screen and (min-device-width: 768px) and (max-device-width: 1024px)'),
yep : ['js/jqm-b2.js'],
nope : ''
}
}
]);
两者都给出了相同的结果,页面显示内容然后在事实之后加载脚本,以便页面从html跳转到突然jquerymobile增强
我使用了生产modernizr下载,以及选定的媒体查询和加载。
非常感谢任何帮助
I am attempting to use modernizr.js to use a media query "mq()" and load ".load()" to have a jquerymobile version of a website fire on load based on the media query result, i am having issue with the .load() function
testing in safari, something is causing a large lag, having the resources load after all the content
after pointing to the modernizr.js, i have tried
<script type="text/javascript" >
Modernizr.load('js/jqm-b2.js');
</script>
and have tried this
Modernizr.load([
{
test : Modernizr.mq('only screen and (min-device-width: 768px) and (max-device-width: 1024px)'),
yep : ['js/jqm-b2.js'],
nope : ''
}
}
]);
both give the same result, page displays content then loads the scripts after the fact, so that the page jumps from html to suddenly jquerymobile enhanced
I used the production modernizr download, and selected media queries and load.
Any help is greatly appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终像这样解决,确保它加载要么/或而不是只是或
ended up solving like this, made sure it loaded either/or rather than just or