Forums

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

Home Forums JavaScript Initiate dropdown onhover instead of onclick Reply To: Initiate dropdown onhover instead of onclick

#208198
bearhead
Participant

Here is a way you can get a select element to expand on hover with jquery:
http://codepen.io/kvana/pen/KdVxaZ

I gave the select box a min-width and overflow:hidden to hide a disabled scroll bar which would have other-wise appeared on hover.

Also, I would advise you NOT to make select boxes expand on hover. Select boxes are a standard html element and users are generally used to them functioning on click. Having it expand on hover strikes me as poor UX and may not function as expected on some mobile devices.