CM-menu 1.0

The CM-menu will provide a specific contextual menu to elements of your page. Each links can be configure with a name, an icon, a shortcut and some sub-links.



Details

Author
Crazy Cooder
Current version
1.0
GitHub
crazycooder/CM-menu
Downloads
2195
Category
Interface
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_: core/1.2.4: '*'

How to use

Using the plugin is simple. Just pass the element reference into the constructor and specify some basics options like the example bellow. More complexes examples are available on demo's website.

HTML

<link rel="stylesheet" type="text/css" href="/Assets/css/CM-menu.css"/>
<script type="text/javascript" src="/Source/CM-menu.js"></script>

JS

$(document.body).getElements('div.frame.smartbox').each(function(smartbox) {
    new CM.menu(smartbox, {
        links: [{
                libelle: 'New',
                icon: 'img/icon/application_add.png',
                onclick: function() { alert('New !!'); },
                links: [{
                        libelle: 'Smartbox',
                        onclick: function() { alert('New Smartbox !!'); }
                    },{
                        libelle: 'Gallery',
                        onclick: function() { alert('New Gallery !!'); },
                        shortcut: {control: true, key: 'g'}
                    },{
                        libelle: 'Video',
                        onclick: function() { alert('New Video !!'); },
                        links: [{
                                libelle: 'From YouTube',
                                onclick: function() { alert('New Video from YouTube !!'); },
                                shortcut: {key: 'y'}
                            },{
                                libelle: 'From Dailymotion',
                                onclick: function() { alert('New Video from Dailymotion !!'); }
                            },{
                                libelle: 'By myself',
                                onclick: function() { alert('New Video by myself !!'); }
                            }
                        ]
                    }
                ]
            }
        ]
    });
});

Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus