Twitter Bootstrap popover trigger: how to set multiple triggers?

前端 未结 5 1446
挽巷
挽巷 2020-12-16 14:27

I\'m trying to use http://twitter.github.io/bootstrap/javascript.html#popovers. I can set the trigger to any one of click | hover | focus | manual. Is there a w

5条回答
  •  伪装坚强ぢ
    2020-12-16 14:48

    Related to this question:

    if anyone uses Bootstrap's popover with AngularJS (using Angular-UI) and wants to define that a popover will be activated "on mouse enter" but deactivated according to one or more events, this code might be helpful:

    app.config(function ($tooltipProvider) {
        // when the user either leaves the element or clicks on it, the tooltip/popover will go off.
        $tooltipProvider.setTriggers({
            'mouseenter': 'mouseleave click',
            'click': 'click',
            'focus': 'blur'
        });
    }
    

提交回复
热议问题