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.
精彩评论