Start a new discussion

To start a new discussion please visit the discussions section of the GitHub home page of the project.

Discussions on GitHub

You can also search our old self-hosted forums for any useful information below but please note that posting new content here is not possible any more.

Re: TypeError: this.$firstLink is null

Home Forums Older releases 0.9.x TypeError: this.$firstLink is null Re: TypeError: this.$firstLink is null

#1618
admin
Keymaster

Hi,

About the first issue – I guess you call this on window resize so you can avoid the JS error (which is harmless, btw) by using a short timeout for the destroy call – i.e. instead of:

$('#drop-menu').smartmenus('destroy');

use this:

setTimeout(function() { $('#drop-menu').smartmenus('destroy'); }, 1);

Because on destroy the script unbinds its own resize handler but still it gets called for the same resize event. It’s a bit tricky to explain but anyway, just use the timeout if the JS error bothers you.

About the second “bug” – it’s not a bug, this is how it works by default. You can read this thread for more info and ways to customize the behavior:

http://www.smartmenus.org/forums/topic/submenu-is-open-indicator

Cheers!