简体   繁体   中英

IE9 Defaulting to IE7, javascript bug

I have this javascript that seems to be forcing IE9 into computability mode and forcing it to IE7. There are other areas of the website working properly that do not have this javascript code working on them, which leads me to believe something in this script is not compatible with IE9/IE7.

Basically, the code creates a pop up box when your mouse hovers over it. However if the pop up box displays over an image, the image shows through the pop up box as if it has precedence. I have tried changing the z-index on that div but no luck.

Any suggestions?

            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库版本中都有问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM