【发布时间】:2013-11-18 17:39:00
【问题描述】:
我有这个似乎强制 IE9 进入可计算模式并强制它进入 IE7 的 javascript。网站的其他区域正常运行,但没有此 javascript 代码在其上运行,这使我相信此脚本中的某些内容与 IE9/IE7 不兼容。
基本上,当您的鼠标悬停在代码上时,代码会创建一个弹出框。但是,如果弹出框显示在图像上方,则图像会通过弹出框显示,就好像它具有优先级一样。我曾尝试更改该 div 上的 z-index,但没有运气。
有什么建议吗?
jQuery('.bubbleInfo').each(function () {
if(jQuery.trim(jQuery(this).find('#dpop').html()) != ''){ // start
var totalHeight = jQuery(this).height();
var distance = 15;
var time = 250;
var hideDelay = 150;
var hideDelayTimer = null;
var beingShown = false;
var shown = false;
var trigger = jQuery('.trigger', this);
var info = jQuery('.popup', this).css('opacity', 0);
jQuery([trigger.get(0), info.get(0)]).mouseover(function () {
if (hideDelayTimer) clearTimeout(hideDelayTimer);
if (beingShown || shown) {
// don't trigger the animation again
return;
} else {
// reset position of info box
beingShown = true;
info.css({
top: (totalHeight+38),
left: -77,
display: 'block'd
}).animate({
top: '-=' + distance + 'px',
opacity: 1
}, time, 'swing', function() {
beingShown = false;
shown = true;
});
}
return false;
}).mouseout(function () {
if (hideDelayTimer) clearTimeout(hideDelayTimer);
hideDelayTimer = setTimeout(function () {
hideDelayTimer = null;
info.animate({
top: '-=' + distance + 'px',
opacity: 0
}, time, 'swing', function () {
shown = false;
info.css('display', 'none');
});
}, hideDelay);
return false;
});
} // end
【问题讨论】:
-
您使用的是哪个 jquery 版本?控制台有错误吗?
-
这个特定页面在
DOCTYPE之前是否有任何内容(文档类型是否与其他工作页面上的相同?) -
是的,DOCTYPE 是一样的。
-
IE9 被强制进入兼容模式,并恢复到问题所在的 IE7。我强迫浏览器停留在当前的 IE 版本。我们只关心 IE9+ 问题,因此现在已修复。
标签: javascript jquery css internet-explorer-7 internet-explorer-9