Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的页面中有 3 个下拉菜单。当我从第一个下拉列表中选择数据时,它会填充第二个下拉列表。如果第二个下拉数据的字符数至少是第一个下拉数据的两倍,它会扩展页面,看起来很糟糕。我想在下拉列表中引入垂直滚动条,这样页面大小就不会扩大。
$('select').attr('size', 5);例如设置最大可见项目...如果它们更多...将出现滚动条...
$('select').attr('size', 5);