admin管理员组文章数量:1301495
Is it possible to create a custom dropdown box using JavaScript and CSS?
For this, I need to place a background image for the dropdown box using JavaScript.
Give any suggestions without using jQuery.
Is it possible to create a custom dropdown box using JavaScript and CSS?
For this, I need to place a background image for the dropdown box using JavaScript.
Give any suggestions without using jQuery.
Share edited Jun 27, 2023 at 20:42 Ghost 5,0597 gold badges24 silver badges48 bronze badges asked May 7, 2009 at 12:30 kumarkumar 1,13714 gold badges34 silver badges60 bronze badges 2- It's possible, but you will have a tough time making the form elements accessible to screen readers.. FYI – Marcy Sutton Commented Feb 13, 2011 at 23:11
- yes it is see my answer below – neel upadhyay Commented Jun 27, 2023 at 8:22
3 Answers
Reset to default 3You can check out jQTransform
Here is a good tutorial on creating custom drop-down.
JQTransform (as suggested by Olafur) is sufficient for me. But if you need more control such as adding icons, it's worth looking at the tutorial.
This might be overkill; but SproutCore gives you input elements posed from images instead of from native HTML elements. There are probably other frameworks that do similar things.
The basic idea is to create a div or something, as CrazyJugglerDrummer suggests, and put click handlers on it. The handlers set up animation to mimic a select element. And when one of your pseudo-select items is selected, you use JavaScript to send that value to an actual select or input element that is hidden.
本文标签: htmlCustom dropdown box using javascript and cssStack Overflow
版权声明:本文标题:html - Custom dropdown box using javascript and css - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741678033a2392000.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论