j-FloatingPanel
- singleton
- supports custom scrollbars
- supports dark mode
Methods:
Method: component.show(options)
options.element {Element/jQuery Element}options.offsetX {Number}optional,xoffset (default:0)options.offsetY {Number}optional,yoffset (default:0)options.offsetWidth {Number}optional,widthoffset (default:0)options.minwidth {Number}optional, a minimal width (default200)options.maxwidth {Number}optional, a maximal width (defaultinfinite)options.height {Number}optional, a height (default:200)options.callback(element) {Function}is triggered when the user clicks on the element with.selectableclassoptions.init {Function}is triggered before the component is displayedoptions.close {Function}optional, can determine closing of paneloptions.align {String}optional,left(default),rightorcenteroptions.position {String}optional,top(default),bottomoptions.classname {String}optional, a custom container class for all items
Method: component.hide()
HTML rendering:
var opt = {};
opt.html = 'Your HTML code';RAW element rendering:
var opt = {};
opt.html = YOUR_DOM_ELEMENT;
// IMPORTANT: if the FloatingBox will be closed, then the element will be moved to the previous parent.Importing content:
var opt = {};
opt.import = '/url/part.html';
// IMPORTANT: the content will be cached for the future usageGood to know
- elements with
selectableclass will be selectable
Methods:
component.up()selects item abovecomponent.down()selects item belowcomponent.select([el])selects item
You can combine methods with j-Shortcuts component.
Use it with <ui-component name="floatingpanel">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<ui-component name="exec"></ui-component>
<ui-component name="floatingpanel"></ui-component>
<span class="exec" data-exec="showpanel" style="color:#2A6CEC;cursor:pointer;text-decoration:underline" class="block">Show panel</span>
<script>
function showpanel(el) {
var opt = {};
opt.element = el;
opt.html = '<div class="padding">Custom content</div>';
SETTER('floatingpanel/show', opt);
}
</script>