Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
jquery menu widget
Play lesson

jQuery tutorial for beginners - jquery menu widget

5.0 (2)
25 learners

What you'll learn

This course includes

  • 22.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/07/jquery-menu-widget.html Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help. https://www.youtube.com/channel/UC7sEwIXM_YfAMyonQCrGfWA/?sub_confirmation=1 In this vide we will discuss jquery menu widget with examples 2 simple steps to get the jQuery menu widget on a page Step 1 : Create an HTML structure with parent/child relationship. The most commonly used element is the unordered list. To disable a menu item add ui-state-disabled class to that list item element. <ul id="menu"> <li>USA <ul> <li>Virginia</li> <li>Maryland</li> </ul> </li> <li>India <ul> <li>AP</li> <li class="ui-state-disabled">MP</li> <li>Karnataka <ul> <li>Bangalore</li> <li>Mangalore</li> <li>Mysore</li> </ul> </li> </ul> </li> <li>UK</li> <li>Australia</li> </ul> Step 2 : Find the unordered list element in the DOM and call menu() function $('#menu').menu(); To control the width, set the preferred with in the .ui-menu class. This class is applied to the unordered list by jquery ui. You can see this using the browser developer tools. <style> .ui-menu{ width:150px } </style> Please note : Another way you can control the width of the menu widget is by placing it as a child element in another element and setting the width of the parent element. <div style="width:150px"> Menu HTML here </div> You can add an icon to a menu item, by applying class names. For the list of icons provided by jQuery http://api.jqueryui.com/theming/icons/ <ul id="menu"> <li><span class="ui-icon ui-icon-flag"></span>USA <ul> <li>Virginia</li> <li>Maryland</li> </ul> </li> ... </ul> To associate a different icon to a submenu, use icons option $('#menu').menu({ icons: { submenu: 'ui-icon-circle-arrow-e' } }); To disable the menu, set disabled option to true $(document).ready(function () { $('#menu').menu({ disabled: true }); }); To get the selected item text, use the select event $('#menu').menu({ select: function (event, ui) { alert(ui.item.text()); } });

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere