javascript - IE9 默认为 IE7,javascript 错误

标签 javascript jquery css internet-explorer-7 internet-explorer-9

我有这个 javascript,它似乎强制 IE9 进入可计算性模式并强制它进入 IE7。网站的其他区域工作正常,但没有此 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

最佳答案

尽管 IE10 支持所有版本的 jquery,但 IE < 10 在 jquery 库版本中存在问题。

关于javascript - IE9 默认为 IE7,javascript 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20054158/

相关文章:

javascript - 使用 react 路由器重定向

javascript - 将参数传递给 Angular ng-include

jquery - jQuery.load() 中的参数未传递给 Controller ​​操作方法

javascript - 如何在自定义页面(而不是商店/产品页面)上添加“添加到购物车”按钮 Woocommerce

css - 在运行文本下放置一个 Angular 形心形 CSS 对象以响应为中心的问题

html - 使用 CSS3 膨胀图像

javascript - JSONP 是否进行异步调用?

c# - 上传文件控件在后面的代码中不显示任何文件

html - 基于表格的布局与基于 Div 的布局

javascript - 如果存在 2 个子 div,隐藏父 div?