这是要了我的命。在 IE7 和 8 中,使用 jqModal,在加载模式内容之前屏幕会闪烁黑色。我已经设置了一个测试应用程序来向您展示正在发生的事情。我已经完全从网站上获取了 jqModal,没有任何更改,没有可能影响我的应用程序的外部 css。它在所有其他浏览器(包括 IE6)中都能完美运行。
因此,前两个链接是 ajax 调用,第二个是直接内联 HTML。(我最初认为是影响它的 ajax,但似乎并非如此,然后我认为它是缓慢加载 ajax,因此有两个不同的 ajax 链接)
疯狂的是 jqmodal 网站本身在 IE 中完美运行,没有闪烁的黑色,但我看不出我做错了什么。代码很简单
html:
<body>
<div id="ajaxModal" class="jqmWindow"></div>
<div id="inlineModal" class="jqmWindow">
<div style="height:300px;position:relative;">
<p>Here's some inline content</p>
<a href="#" onclick='$("#inlineModal").jqmHide();return false;' style="position:absolute;bottom:10px;right:10px">Close</a>
</div>
</div>
<div style="width:600px;height:400px;margin:auto;background:#eee;">
<p><a href="/ajax/short" class="jqModal">Short loading modal</a></p>
<br />
<p><a href="/ajax/long" class="jqModal">Longer loading modal</a></p>
<br />
<p><a href="#" class="jqInline">inline modal</a></p>
</div>
</body>
Javascript:
<script type="text/javascript">
$(function(){
$("#ajaxModal").jqm({ajax:'@href', modal:true});
$("#inlineModal").jqm({modal:true, trigger:'.jqInline'});
});
</script>
CSS 与从 jqModal 网站下载的完全一样,所以我会省略它,但你可以在我的应用程序上看到它
有没有人经历过这个?我不明白他的作品和我的不明白。