选择可能的下拉列表为“下拉” [英] Select drop-down list possible to "Drop-Up"

查看:83
本文介绍了选择可能的下拉列表为“下拉”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< select>< option> foo< / option>< / select> 下拉式选单太靠近页面底部。我想让下拉列表下拉。我一直在搜索,但只能提取导航菜单上的信息。我试着给予< select class =select-store> a top:100%and bottom:100%as position:absolute这是我在导航中看到的菜单下拉列表中选择下拉而不优先。这可能吗?先谢谢你们,代码如下:

The <select><option>foo</option></select> drop-down is too close to the bottom of the page. I would like the drop-down to "drop-up". I have been searching but only able to pull up information on navigation menus. I tried giving the <select class="select-store"> a top:100% and bottom:100% being position:absolute which is what I saw for navigation menu dropdowns to "drop-up" without prevail. Is this possible? Thank you guys in advance, code is below;

HTML

<select class="select-store" onchange="document.location.href=this.value">
  <option value="/">Store Finder</option>
  <option value="/foo">foo</option>
  <option value="/beta">beta</option>
</select>

CSS

#finder .select-store{
  background: url("/images/storefinder_bg.png") no-repeat scroll 0 0 transparent;
  border: medium none;
  color: #5B5A5A;
  font-family: UNIV-C,Arial,Helvetica,sans-serif;
  font-size: 16px;
  font-weight: normal;
  height: 32px;
  line-height: 16px;
  padding: 3px;
  vertical-align: middle;
  width: 186px;
}


推荐答案

SELECT 元素行为由浏览器决定。它单独检测视口外的溢出,有时会重新定位列表。

SELECT element behaviour is determined by the browser. It alone detects overflow outside of the viewport and will sometimes reposition the list. You can't control this directly.

现在,如果您使用基于脚本的模拟SELECT,您可以检测JS代码中的溢出并相应地重新定位。

Now if you use a script-based simulated SELECT, the you can detect overflow in your the JS code and reposition accordingly.

这篇关于选择可能的下拉列表为“下拉”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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