By default, to open or display the dropdown menu in Bootstrap you have to click on the trigger element. However, if you want to show the dropdown on mouseover instead of click you can do it with little customization using the CSS and jQuery.
As you can see in the above example, we've used the CSS media query for showing the dropdown menu on mouse hover only on small, medium and large devices, because it is not appropriate for the extra small devices like cell-phones. We've also used some jQuery to add .open class to highlight the active dropdown element.
Use the jQuery
hover()
methodBy default, to open or display the dropdown menu in Bootstrap you have to click on the trigger element. However, if you want to show the dropdown on mouseover instead of click you can do it with little customization using the CSS and jQuery.
As you can see in the above example, we've used the CSS media query for showing the dropdown menu on mouse hover only on small, medium and large devices, because it is not appropriate for the extra small devices like cell-phones. We've also used some jQuery to add .open class to highlight the active dropdown element.
need an explanation for this answer? contact us directly to get an explanation for this answer