Text Selection Popup With Pure JavaScript

Category: Javascript , Modal & Popup | November 29, 2017
Author:erdembircan
Views Total:2,586 views
Official Page:Go to website
Last Update:November 29, 2017
License:MIT

Preview:

Text Selection Popup With Pure JavaScript

Description:

A JavaScript plugin that adds a popup menu to text selections just you seen on Medium.com. Typical use cases for this application include text editor, share sharing and more.

See also:

Installation:

# NPM
$ npm install selection-popup --save

Import the library

// ES 2015
import selectionPopup from 'selection-popup';

// CommonJS:
const selectionPopup = require('selection-popup');

Basic usage:

  • items: menu items
  • callbacks: click callbacks for items
  • options: options array
selectionPopup(items, callbacks, options)

Add your own styles:

selectionPopup(items, callbacks, {
  {style: 'background-color:#222'}
})

You Might Be Interested In:


Leave a Reply