IE throws an error in this section of JavaScript

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

'undefined' is null or not an object

Does anyone know why? I can not find what is 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: 'fast'
        });
    }
);
+3
source share
3 answers

Try removing the extra comma after extraWidth: 1.

Note. I do not have IE on this computer, so I can not verify this, but your syntax is completely correct. I assume IE sees an extra comma, fails, and instead sends undefinedto supersubs.

+5
source

You had an extra comma after "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'
        });
    }
);
+1
source

, , jQuery , css. ul sf- .

0
source

All Articles