xxxxxxxxxx
<input id="input" onclick="$(this).w2tag('This is not valid');">
xxxxxxxxxx
options: {
id : null, // id for the tag, otherwise input id is used
html : text, // or html
position : 'right', // can be left, right, top, bottom
align : 'none', // can be none, left, right (only works for position: top | bottom)
left : 0, // delta for left coordinate
top : 0, // delta for top coordinate
style : '', // addition style for the tag
css : {}, // add css for input when tag is shown
className : '', // add class bubble
inputClass : '', // add class for input when tag is shown
hideOnKeyPress : true, // hide tag if key pressed
hideOnBlur : false, // hide tag on blur
hideOnClick : false, // hide tag on document click
onShow : null, // callBack when shown
onHide : null // callBack when hidden
}
xxxxxxxxxx
<input id="input" onclick="
var html = '<div style=\'padding: 10px\'>This is an overlay.<br>Can be multi line HTML.</div>';
$(this).w2overlay(html)">
xxxxxxxxxx
options: {
name : null, // it not null, then allows multiple concurrent overlays
html : '', // html text to display
align : 'none', // can be none, left, right, both
left : 0, // offset left
top : 0, // offset top
tipLeft : 30, // tip offset left
noTip : false, // if true - no tip will be displayed
selectable : false, // if text is selectable inside the overlay
width : 0, // fixed width
height : 0, // fixed height
maxWidth : null, // max width if any
maxHeight : null, // max height if any
contextMenu : false, // if true, it will be opened at mouse position
pageX : null, // pageX from event.pageX object (for contextMenu)
pageY : null, // pageY from event.pageY object (for contextMenu)
originalEvent : null, // original event (instead of pageX and pageY)
style : '', // additional style for main div
class : '', // additional class name for main div
overlayStyle : '', // css style of entire overlay
onShow : null, // event on show
onHide : null, // event on hide
openAbove : false, // show above control
tmp : {}
}
xxxxxxxxxx
<input id="input" onclick="
$(this).w2menu({
items: [
{ id: 1, text: 'Edit', icon: 'fa fa-star' },
{ id: 2, text: '--'},
{ id: 3, text: 'Copy', icon: 'fa fa-star' },
{ id: 4, text: 'Paste', img: 'icon-page', disabled: true },
{ id: 5, text: 'Hidden', img: 'icon-page', hidden: true },
{ id: 6, text: '--'},
{ id: 7, text: 'Delete Item', img: 'icon-page' }
],
onSelect: function (event) {
console.log(event);
}
});">
xxxxxxxxxx
options: {
type : 'normal', // can be normal, radio, check
items : [], // array of items
render : null, // function (menu_item, options) - when menu item is rendered
spinner : false, // indicates if to show spinner
onSelect : null // function (event) - when menu item is selected
search : false, // indicates if to display search control
// --- only when search is true ---
match : 'begins', // can be is, begins, ends
altRows : false, // display alternate background color
index : 0, // index of the selected item (when selected by keyboard)
msgNoItems : 'No Items', // default message where no items found
}
xxxxxxxxxx
item : {
id : null, // unique id
text : '', // text for the item
icon : '', // icon class
img : '', // image class
count : null, // count badge value
style : '', // additional styles
hotKey : '', // text to indicate what is hot key for the item
tooltip : '', // tooltip for the item
hidden : false, // indicates if hidden
checked : false, // indicates if menu is checked (for check and radio)
disabled : false, // indicates if disabled
// other custom properties
}
xxxxxxxxxx
<input id="input" onclick="
$(this).w2menu({ color: '#000000', transparent: true }, function (color) {
console.log('selected color is ' + color);
});">