Модифицированное принятое решение. То, что я испытал, было то, что после того, как некоторые popovers были спрятаны, их нужно было бы дважды щелкнуть, чтобы снова появиться. Вот что я сделал для обеспечения того, чтобы popover ('hide') не вызывался на уже скрытые popovers.
$('body').on('click', function (e) {
$('[data-original-title]').each(function () {
//the 'is' for buttons that trigger popups
//the 'has' for icons within a button that triggers a popup
if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
var popoverElement = $(this).data('bs.popover').tip();
var popoverWasVisible = popoverElement.is(':visible');
if (popoverWasVisible) {
$(this).popover('hide');
$(this).click(); // double clicking required to reshow the popover if it was open, so perform one click now
}
}
});
});
Да, вы можете добавить свойство title к каждому элементу. Но я сомневаюсь, что ваши посетители заметят этот довольно тонкий намек.
foreach (ListItem item in YourDropDownList.Items)
{
item.Attributes.Add("title", "(the long description)");
}