对样式下拉表单感到沮丧
我想设计一个下拉表单的样式,使其看起来与操作系统驱动的表单完全不同。众所周知,这是使表单在跨浏览器上表现良好的一个问题,我还没有找到一个好的解决方案。
我试过这个脚本: http://www .devirtuoso.com/2009/08/styling-drop-down-boxes-with-jquery/ 它适用于具有少量可选项目的下拉表单,但是当需要滚动条以允许用户导航到他们想要的数据项时,它开始破坏跨浏览器。
我的下拉菜单有 250 个这样的值,所以我的前端已经损坏了。可以使用鼠标滚轮进行精细导航,但如果用户选择向上 ↑ 或向下 ↓ 操作系统按钮在列表中上下导航,则表单会立即消失。
有人能够破解自定义样式下拉菜单吗?有解决方法吗?也许需要不同的脚本?
谢谢。
I want to style a dropdown form so that it appears completely differently to an OS driven form. This is notoriously a problem to make the form behave well cross browser and I'm yet to find a good solution.
I've tried this script: http://www.devirtuoso.com/2009/08/styling-drop-down-boxes-with-jquery/
which works fine for dropdown forms which have a small number of selectable items however it starts to break down cross-browser when a scroll bar is required to allow the user to navigate to the data item they desire.
My dropdown has 250 such values so I'm left with a broken front-end. The mouse wheel can be used to navigate fine, but the form instantly disappears if the user selects the up ↑ or down ↓ OS buttons to navigate up and down the list.
Has anyone be able to crack custom styling dropdowns? Is there a workaround? Maybe a different script is in order?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你见过 jQueryUI Selectmenu 插件吗? 我还没有尝试过像你一样多的值正在描述,但它是一个非官方的 jQueryUI 插件,所以它可能是你最好的选择。另外,它是可访问的,并且会在不启用 JavaScript 的情况下为您的用户优雅地降级。
Have you seen the jQueryUI Selectmenu plugin? I haven't tried it with as many values as you're describing, but its an unofficial jQueryUI plugin, so it might be your best bet. Plus it's accessible and will gracefully degrade for your users without JavaScript enabled.