Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mouse pointer on hover of Twitter Bootstrap dropdown nav

Tags:

When I hover over the dropdown in my navbar, the mouse changes to the text pointer instead of the hand pointer that should show for a link.

Here's my html:

<ul class="nav">   <li class="active"><%= link_to 'Home', root_path %></li>   <li><a href="#">Forums</a></li>   <li class="dropdown">     <a data-target="#" class="dropdown-toggle" data-toggle="dropdown" role="button">       World vs. World       <b class="caret"></b>     </a>     <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">       <li><%= link_to 'Current Match', current_match_path %></li>       <li><%= link_to 'All NA Matches', wvw_path %></li>     </ul>   </li> </ul> 

Anybody know how I can fix this?

like image 600
Cristiano Avatar asked Oct 20 '13 15:10

Cristiano


People also ask

How do I make Bootstrap navbar dropdown work on hover?

Answer: Use the jQuery hover() method 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.

How do you toggle a hover dropdown?

Example ExplainedUse any element to open the dropdown menu, e.g. a <button>, <a> or <p> element. Use a container element (like <div>) to create the dropdown menu and add the dropdown links inside it. Wrap a <div> element around the button and the <div> to position the dropdown menu correctly with CSS.

How do I make my cursor hover?

You can simply use the CSS cursor property with the value pointer to change the cursor into a hand pointer while hover over any element and not just hyperlink. In the following example when you place the cursor over the list item, it will change into a hand pointer instead of the default text selection cursor.


2 Answers

We're missing your CSS, but I would go for a simple cursor: pointer :

.dropdown-menu li:hover {     cursor: pointer; } 
like image 65
zessx Avatar answered Sep 20 '22 13:09

zessx


An alternative to cursor:pointer is adding an inert href attribute for the <a>, e.g. href="#" (although some object to this).

like image 39
waldyrious Avatar answered Sep 17 '22 13:09

waldyrious