Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.
/ JqContextMenu Public archive

Custom context menu builder Jquery plugin

License

Notifications You must be signed in to change notification settings

relliv/JqContextMenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JqContextMenu

Custom context menu builder Jquery plugin

Creating an Menu

$('#content').jqContextMenu({
    contextMenu: [{
            icon: 'lnr lnr-pencil',
            text: 'Edit',
            dataKey: 'edit'
        },
        {
            icon: 'lnr lnr-file-empty',
            text: 'Copy',
            dataKey: 'copy'
        },
        {
            icon: 'lnr lnr-bookmark',
            text: 'Add to Bookmarks',
            dataKey: 'bookmark'
        },
        {
            icon: 'lnr lnr-pie-chart',
            text: 'Stats',
            dataKey: 'stats',
        },
        {
            icon: 'lnr lnr-trash',
            text: 'Delete',
            dataKey: 'bookmark'
        }
    ]
});

Handling clicks

$(document).on('mousedown', '#content #jqcontext-menu li', function () {
    var dataKey = $(this).attr('data-key');

    if (dataKey == 'edit'){
        alert('you clicked "edit" button');
    } else {
        alert('you clicked ' + dataKey+ ' button');
    }
});

About

Custom context menu builder Jquery plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published