Git Product home page Git Product logo

radial-menu-js's Introduction

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');
 openMenu.onclick = function () {
   svgMenu.close();
 };

License

MIT

radial-menu-js's People

Contributors

axln avatar

Forkers

revelts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.