What is Hamburger Menu
It is a jQuery plugin for web applications on mobile devices.
This plugin helps the web developer to easily build web applications menus on mobile devices.
Click here to go to the GitHub jsonQuery repository.
Click here to view a demo.
Click here to download the demo.
Table of contents
It is very easy to be used. Just add the following element to your HTML code:
And run the following javascript:
Try a demo of HambugerMenu in action here.
Getting Started
1º. Add a reference to amburgerMenu style sheet. You can customize this file for getting the appearance of your web application.
2º. Add a reference to jQuery library.
3º. Add a reference to jQueryui library. This library is optional for add an animation effect to display the menu.
4º. Add a reference to amburgerMenu library.
5º. Add the following element to your HTML code.
6º. Finally encapsulates the content of your page into a div element. The html structure would be like:
And run the following javascript to generate the menu:
mainContent: It is the container that encapsulates the content of your page.
The json format to create the menu is shown below:
Instead of json data you can pass a URL as a parameter. This url has to return a json with the data of the menu. amburgerMenu conduct a ajax call to this url and generate the menu. For this and more features click on the "options reference" menu.
Options Reference
mainContent: Identifier of Container that encapsulates the content of your page.
url: Url that return a json with the menu. AmburgerMenu conduct a ajax call to this url and generate the menu.
urlType: Type ajax call (get, post, ..) to url for generate the menu.
urlCache: True or false. If the ajax call is cached or not.
urlParam: Parameters to be passed to the ajax call.
onClickHamburgerMenu: Callback function for the click event of each menu.
Example:
You can pass another parameter with the data of the menu in json format. With these data the menu will be formed if the url parameter is not passed.
position: The side where the menu is placed. left or right.
fromTo: Values: leftRight, rightLeft, topDown. Side from where the menu start and where it moves to.







Comments
Post a Comment