Open In App

How to make Bootstrap popover appear/disappear on hover instead of click?

Bootstrap provides in-built support for making popovers. A popover is a content box that appears when a user triggers a specific event with specified element selector. Here, we will discuss methods to trigger popover using “hover” instead of “click”.

Method 1: Here, we will specify popover trigger in ‘hover’ using jQuery initialization only. We can add title details as well as trigger criteria in popover() function itself as parameters.

Method 2: Here we will be using ‘data-trigger’ attribute. We can also achieve the same by placing ‘title’ and ‘data-trigger’ as attributes without specifying them as parameters in popover() method.


Article Tags :