I'm using popover to display an image which doesn't require a title. If you don't set "title", it still displays an area where the title would be. How do you turn this off completely?
To hide the displayed popover, use the popover(“hide”) method.
Tooltip: use tooltips to show a short text to respondents when they hover over a word or icon. Popover: use popovers to show a longer text, or when you want to have a link to an external web page. It is shown when the respondent clicks on a word or icon.
If you have multiple popovers on your page and only want to style one of them, you can leverage the popover's template option to add another class: $("#myElement"). popover({ template: '<div class="popover my-specific-popover" role="tooltip">...' });
Set the trigger option of the popover to hover instead of click , which is the default one. Or with an initialization option: $("#popover"). popover({ trigger: "hover" });
baptme's suggest is ok, but the better way would be to specify your popover's title and actually hide it completely as margins still exist with a height of 0.
.popover-title { display: none; }
Edit: just quicky looked at the source and there seems to be an undocumented option:
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { placement: 'right' , content: '' , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>' })
When you declare your popover using JS, try to override the template and specify a hidden title.
$('#example').popover({ template: '...<h3 class="popover-title" style="display: none"></h3>...' });
The reason I say don't remove it is it may cause runtime errors if the element doesn't exist. See Sherbrow's comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With