ForgeComponents
en

Components

j-FloatingInput

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • singleton
  • supports dark mode

Methods:

Method: component.show(options)

  • options.element {Element/jQuery Element}
  • options.offsetX {Number} optional, x offset (default: 0)
  • options.offsetY {Number} optional, y offset (default: 0)
  • options.offsetWidth {Number} optional, width offset (default: 0)
  • options.placeholder {String} optional, a placeholder for search field
  • options.minwidth {Number} optional, a minimal width, default 200
  • options.maxwidth {Number} optional, a maximal width, default infinite
  • options.maxlength {Number} optional, a maximal length of value, default 50
  • options.callback(value, element) {Function} is triggered when the user clicks on the item
  • options.icon {String} optional, Font-Awesome icon
  • options.close {Function} optional, can determine closing of panel
  • options.align {String} optional, left (default), right or center
  • options.value {String} optional, a default value for the input
  • options.position {String} optional, top (default), bottom
  • options.summary {String} additional help content
  • options.monospace {Boolean} enables monospace font
  • options.select {Boolean} selects text
  • NEW options.multiline {Boolean} enables multiline
  • NEW options.height {Number} a height for multiline (default: 100)

Method: component.hide()

Configuration:

  • placeholder - a placeholder for the input

Use it with <ui-component name="floatinginput">. 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.

example.html
<style>
	body { background-color: #F0F0F0; }
</style>

<ui-component name="floatinginput" config="placeholder:Type something ..."></ui-component>

<div class="container">
	<a href="javascript:void(0)">Type your name</a>
</div>

<script>
	$(document).on('click', 'a', function() {

		var opt = {};
		opt.element = this;
		opt.callback = function(value) {
			console.log('CLICK', value);
		};

		SETTER('floatinginput/show', opt);
	});
</script>