The expanded() method accepts two types of options.
1. An optional Boolean value, specifying whether the item identified should be expanded or collapsed.
2. A variable list of numeric values (zero-based indexes), specifying the context menu level. For example, an argument list of (true, 3, 2) specifies that the fourth element from the first context menu and the 3rd from the secondary sub menu.
If the first element is omitted, then the state of the specified index (expanded or collapsed) is returned.

<ul id="contextmenu1">
            <li>Save As</li>
<button id="button1" type="button">Context Menu</button>

<script type="text/javascript">

                target: "body"               

            $("#button1").click(function handleMenu() {                
                //Options context menu item gets expanded
                $("#contextmenu1").swidget().expanded(false, 1);