Socket
Socket
Sign inDemoInstall

jquery-contextify

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jquery-contextify

A lightweight jQuery plugin for creating Bootstrap powered context menus.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.23 MB
Created
Weekly downloads
 

Readme

Source

jQuery Contextify - Lightweight Context Menu

A lightweight jQuery plugin for creating Bootstrap powered context menus.

Build Status Dependency Status

Setup

Load from CDN

The easiest way to get up and running is to load jQuery Contextify using a CDN. Make sure jQuery is loaded first though.

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-contextify/1.0.7/jquery.contextify.min.js"></script>

or

<script src="//cdn.jsdelivr.net/jquery.contextify/1.0.7/jquery.contextify.min.js"></script>

Install with Bower

Use the following command to install jQuery Contextify using bower.

$ bower install jquery-contextify

Or simply add jquery-contextify to your project's bower.json.

  "dependencies": {
    "jquery-contextify": "latest"
  }

Download

You can also just download the latest package.

  • Download latest version
  • or curl -O https://raw.github.com/abeMedia/jquery-contextify/master/dist/jquery.contextify.js

Usage

jQuery Contextify needs to be activated via JavaScript.

$('.foo').contextify(options);

The menu items are passed as an array in options.items. See the following example for creating a basic context menu.

<a class="foo" href="#" data-name="John">Click me</a>

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-contextify/1.0.7/jquery.contextify.min.js"></script>
<script>
var options = {items:[
  {header: 'Options'},
  {text: 'First Link', href: '#'},
  {text: 'Second Link', onclick: function(e) {
    alert('Hello ' + e.data.name);
  }},
  {divider: true},
  {text: 'Stuff', href: '#'}
]}
$('.foo').contextify(options);
</script>

This will initiate jQuery Contextify on the .foo elements with the menu items specified in options.items.

Options

NameTypeDefaultDescription
itemsarray[]An array of menu item objects.
actionstringcontextmenuThe action on which to display the context menu (can be contextmenu, click or mouseover).
menuIdstringcontextify-menuThe id attribute of the context menu.
menuClassstringdropdown-menuThe class attribute of the context menu.
headerClassstringdropdown-headerThe class attribute of menu headers.
dividerClassstringdividerThe class attribute of menu dividers.

© 2014-2016 Adam Bouqdib - http://abemedia.co.uk

Keywords

FAQs

Last updated on 11 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc