【发布时间】:2014-07-05 14:22:24
【问题描述】:
所以我遇到了一个问题,我的页面在网站导航时闪烁。 IE,当我单击标题中的链接时,页面在渲染之前会短暂闪烁为白色。这仅发生在 IE(当前使用版本 11)中,而它似乎在 Chrome 和 Firefox 中缓存良好。
这是该网站的链接:Kelsey's Kreations。
这是我页面头部的代码:
<head>
<title>Flavors - Kelsey's Kreations</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
<!--[if IE]><script>document.createElement('main');</script><![endif]-->
<script src="http://use.typekit.net/dxe8zqc.js"></script>
<script>try{Typekit.load();}catch(e){}</script>
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/fa.css">
</head>
这是我页面底部的代码:
...
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script src="../js/header.js"></script>
</body>
我已经尝试过“Page-Enter”黑客,但它们似乎在 IE9 中已被弃用。
我尝试将js移到页面底部,但是头部的脚本必须保留,否则会导致所有浏览器出现其他问题。
【问题讨论】:
-
我没有看到任何闪烁。它可能是一个视频卡,但怀疑它。也可能是您的病毒扫描程序干扰了 IE,他们在 IE 中做疯狂的事情。检查您是否处于兼容模式,您可以在 F12 工具中进行检查。您的某些图像偏大,您可能希望优化那些下载速度更快的图像。它们在核心内容呈现后加载。
-
主要是svg横幅和标题最困扰我。在其他浏览器上浏览网站时,标题保持不变并提供一致的感觉,但在 IE 上它会短暂闪烁白色。
标签: jquery css html internet-explorer caching