Reply To: How to set option after initialization

Home Forums Older releases 0.9.x How to set option after initialization Reply To: How to set option after initialization

#2550
admin
Keymaster

Changing some options at runtime (like “subIndicators”) will not have any effect since they are only used at init so these options need to be passed on the init call. But, of course, it’s not a problem to change others (e.g. “showTimeout”, “showOnClick”, etc.) and you can do it like this:

$('#main-menu').data('smartmenus').opts.optionName = newValue;

So if you have the #my-button button, you can do it onclick with the following code:

$('#my-button').click(function() {
	$('#main-menu').data('smartmenus').opts.optionName = newValue;
	return false;
});

Register

You will be emailed a link to set your password.

Login

Lost password?