This jQ plugin creates a popover under the input tag on which it is called
Option | Type | Default | Description |
---|---|---|---|
container | string | false | false | Appends the popover to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize. |
class | string | 'search-popover' | class add popover |
focusOut | boolean | true | close when losing focus |
parentWidth | string | false | false | uses the width of the specified element, defaults to the width of the input |
var content = '<div> </div>'
$($0).inputPopover('show', content)
$(function () {
$('.search__input').inputPopover()
// simply initialize the plugin or initialize the settings $($0).inputPopover({container: 'body'})
// now can cause Popover and give him the content
$('.search__input').keyup(function () {
var text = $(this).val()
if (text.length > 2) {
$('.search__input').inputPopover('show', '<div>' + text + ' <a href="#" class="btn btn-primary">search</a></div>')
}
})
})