开发者

IE is throwing an error at this section of JavaScript

开发者 https://www.devze.com 2023-03-08 00:13 出处:网络
This code is throwing the following error in IE, but not in any other browser: \'undefined\' is null or not an object

This code is throwing the following error in IE, but not in any other browser:

'undefined' is null or not an object

Does anyone know why? I can't find what's wrong with the code.

jQuery(document).ready(
    function() {
        jQuery("ul.sf-menu").supersubs({
            minWidth: 12,
            maxWidth: 27,
            extraWidth: 1,
        }).superfish({
            delay: 100,
            animation: { opacity: 'show' },
            speed: 'fas开发者_运维百科t'
        });
    }
);


Try removing the extra comma after extraWidth: 1.

Note: I do not have IE on this computer so I can't test this, but your syntax is completely correct otherwise. My guess is that IE sees the extra comma, fails, and passes undefined to supersubs instead.


You had an extra comma after the "extraWidth: 1"

jQuery(document).ready(
    function() {
        jQuery("ul.sf-menu").supersubs({
            minWidth: 12,
            maxWidth: 27,
            extraWidth: 1
        }).superfish({
            delay: 100,
            animation: { opacity: 'show' },
            speed: 'fast'
        });
    }
);


According to this link from a previous post, it may be due to the jQuery trying to modify or create a value that has not been explicitly declared in your css. Try setting width values for ul with class sf-menu.

0

精彩评论

暂无评论...
验证码 换一张
取 消