Home › Forums › JavaScript › Initiate dropdown onhover instead of onclick › Reply To: Initiate dropdown onhover instead of onclick
September 15, 2015 at 10:31 am
#208198
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.