第一次将鼠标悬停在图标上时,Popover 不起作用
Popover doesn't work at first time hover on icon
下面是用于在悬停时加载弹出窗口的代码,它不会在第一次悬停时加载。它在第二次悬停时工作正常
<i id="weaCarrierIcon" class="fas fa-info-circle fa-lg infoIcon weaCarrier-infoicon" ng-click="weaCarrierPopover()" ng-mouseover="weaCarrierPopover()" data-toggle="popover" data-content="{{model.weaCarrierPopover}}"></i>
$scope.weaCarrierPopover = function () {
$('#weaCarrierIcon').popover({ placement: 'bottom', trigger: 'hover', html: true, delay: { show: 50, hide: 400 } });
};
$scope.weaCarrierPopover = 函数 () {
$('#weaCarrierIcon').popover({ placement: 'bottom', trigger: 'hover', html: true, delay: { show: 50, hide: 400 } }).popover ('show');
};
添加 .popover('show') 解决了这个问题。
下面是用于在悬停时加载弹出窗口的代码,它不会在第一次悬停时加载。它在第二次悬停时工作正常
<i id="weaCarrierIcon" class="fas fa-info-circle fa-lg infoIcon weaCarrier-infoicon" ng-click="weaCarrierPopover()" ng-mouseover="weaCarrierPopover()" data-toggle="popover" data-content="{{model.weaCarrierPopover}}"></i>
$scope.weaCarrierPopover = function () {
$('#weaCarrierIcon').popover({ placement: 'bottom', trigger: 'hover', html: true, delay: { show: 50, hide: 400 } });
};
$scope.weaCarrierPopover = 函数 () { $('#weaCarrierIcon').popover({ placement: 'bottom', trigger: 'hover', html: true, delay: { show: 50, hide: 400 } }).popover ('show'); };
添加 .popover('show') 解决了这个问题。