Skip to content

matvejs16/radial-menu-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Radial Menu in Pure JavaScript, HTML and SVG

Radial menu screenshot

Controls

  1. Go to https://axln.github.io/radial-menu-js/index.html.

  2. Click Open Menu button.

  3. You can use mouse, mouse wheel and keyboard for navigation:

    • Arrow keys and mouse wheel to select menu item.
    • Enter to choose the selected menu item.
    • Esc/Backspace to return to parent menu and close menu.

Usage Example

var svgMenu = new RadialMenu({
   parent      : document.body,
   size        : 400,
   closeOnClick: true,
   menuItems   : [
     {
       id: 'item1',
       title: 'Item 1'
     },
     {
       id: 'item2',
       title: 'Item 2'
     },
     {
       id: 'more',
       title: 'More...',
       items: [
         {
           id: 'subitem1',
           title: 'Subitem 1'
         },
         {
           id: 'item2',
           title: 'Subitem 2'
         }
       ]
     }
   ],
   onClick: function (item) {
     console.log('You have clicked:', item);
   }
});

 var openMenu = document.getElementById('menu');
 openMenu.onclick = function () {
   svgMenu.open();
 };

 var closeMenu = document.getElementById('close');
 closeMenu.onclick = function () {
   svgMenu.close();
 };

License

MIT

About

Radial menu in pure JavaScript, HTML and SVG

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 57.0%
  • HTML 39.6%
  • CSS 3.4%