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()
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