joeldbirch / superfish

Superfish is a jQuery plugin that adds usability enhancements to existing multi-level drop-down menus.
Other
913 stars 314 forks source link

Supersubs: TypeError: fontsize.attr(...).appendTo(...)[0] is undefined #163

Open jacobembree opened 8 years ago

jacobembree commented 8 years ago

When the menu contains only one item, hence, no children, this error will occur.

supersubs.js: }).appendTo($$)[0].clientWidth; //clientWidth is faster than .width() That line expects an array of elements. If there is only one then the error will occur. If instead of [0], .first() is used, the same result will be achieved without the requirement that there be more than one element. The line would then become: .appendTo($$).first().clientWidth; //clientWidth is faster than width()

See also: "TypeError: fontsize.attr(...).appendTo(...)[0] is undefined" Issue With NavBar