Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How to open a div on click of a search button exactly below the search box. Reply To: How to open a div on click of a search button exactly below the search box.

#146377
Tom Houy
Participant

You could apply a hover effect to the submit button with CSS, something like this:

http://cdpn.io/bzope

If you just use the Active state, it will only be visible when the button is pressed down. You would still need a little bit of javascript if you want the maps div to stay open after they release the mouse button.

.testbox {
background-color: #FF0;
padding: 15px;
height: 50px;
width: 200px;
display: none;
}
.testbutton:hover + .testbox, .testbutton:active + .testbox {
display: block;
}