如何使用 jQuery 移动设备从 HTML 文件加载样式且不闪烁屏幕?
How to load from a HTML File with style and without flickering screen with jQuery Mobile?
我想用这个函数(index.html)加载templates/finden.html文件中的内容,并且不闪烁。
$("#finden").click(function(){
$("#content").load("templates/finden.html");
$("#header_titel").html("Gerichte finden");
});
我在 index.html 中添加了 jQuery 和 jQuery 手机。
<link rel="stylesheet" href="js/jquery.mobile-1.4.5.min.css">
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/jquery.mobile-1.4.5.min.js"></script>
问题是,我的 templates/finden.html 中也需要这些命令。但是当我这样做时,页面在变化的同时闪烁。如果我不包含这些命令,闪烁就会消失,但我的页面中不再有 jQuery 移动样式。
$(document).on('click', '#finden', function(){
$("#content").load("templates/finden.html", function() {
$(this).trigger("create");
$("#header_titel").html("Gerichte finden");
});
});
适合我
我想用这个函数(index.html)加载templates/finden.html文件中的内容,并且不闪烁。
$("#finden").click(function(){
$("#content").load("templates/finden.html");
$("#header_titel").html("Gerichte finden");
});
我在 index.html 中添加了 jQuery 和 jQuery 手机。
<link rel="stylesheet" href="js/jquery.mobile-1.4.5.min.css">
<script src="js/jquery-1.11.3.min.js"></script>
<script src="js/jquery.mobile-1.4.5.min.js"></script>
问题是,我的 templates/finden.html 中也需要这些命令。但是当我这样做时,页面在变化的同时闪烁。如果我不包含这些命令,闪烁就会消失,但我的页面中不再有 jQuery 移动样式。
$(document).on('click', '#finden', function(){
$("#content").load("templates/finden.html", function() {
$(this).trigger("create");
$("#header_titel").html("Gerichte finden");
});
});
适合我