nttaylor
nttaylor

Reputation: 828

tweaking jquery-ui menu widget

Working on making a very standard dropdown menu with the new jquery ui 1.9 menu widget, but having some problems due to the newness of the widget and the presence of only a single extremely basic example at jqueryui.com

Specifically, can anyone here help me to:

  1. Initialize a widget with no icons for submenus? (Default is a right-facing carat and I can't get rid of it)

  2. Make a menu where user has to click on the top menu item (as opposed to just hovering) to make the submenu appear? Any deeper submenus should then expand when the user's pointer hovers over them. This is typical dropdown behavior, e.g., user clicks "edit" to make options appear like "select" or "undo", but any further choices under (for example) "select" would apper just by hovering over "select". I hope that's clear.

Thanks

Upvotes: 2

Views: 463

Answers (1)

jmm
jmm

Reputation: 990

I don't know how to do the second part of your question but I can answer the first question.

You can change the default icon by setting the icon option of the menu option.

First add a class to your CSS file like this.

.no-icon { display:none;}

Then set the icon option when you create the menu.

$( "#menu" ).menu(
    { icons: { submenu: "no-icon" } }
);

You won't have any icons. Here is a fiddle

Upvotes: 1

Related Questions