在 jQuery 中显示选择下拉列表? [英] Show select dropdown in jQuery?

查看:19
本文介绍了在 jQuery 中显示选择下拉列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
你如何以编程方式告诉 HTML SELECT 下拉(例如,由于鼠标悬停)?

是否可以使用 jQuery 使 select 元素上的下拉列表可见?

Is it possible to make the dropdown on a select element visible with jQuery?

我尝试使用 $('#dropdown').click();,但没有效果.

I tried using $('#dropdown').click();, but it has no effect.

推荐答案

这是不可能的.您只能实现自己的选择框,但这不利于可用性.

This is not possible. You can only implement your own select-box, but this is bad for usability.

另一种方法是以编程方式更改选择框的大小属性,但这并不是您真正想要的.

another approach is to programmatically change the size-attribute of the select-box, but this is not really what you wanted.

我建议考虑一下您为什么需要这个,以及是否有更好的软件模式?

I suggest to think of why you need this and if there would be a nicer software-pattern?

这篇关于在 jQuery 中显示选择下拉列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆