我使用jQuery Selectric插件来自定义选择.
$('select').selectric({
disableOnMobile: false
});
Run Code Online (Sandbox Code Playgroud)
如果我在iPad设备上打开选择,我的左栏会向上移动
.left-column {
position: fixed;
left: 0;
top: 0;
width: 200px;
height: 100vh;
background: #F00;
z-index: 100;
}
Run Code Online (Sandbox Code Playgroud)
请帮忙.在这里演示:http://output.jsbin.com/seleyi
UPD:在browserstack iOS <7测试 - 没问题,iOS 8.3 - 有一些问题,iOS 9.1有这个bug
基于名称以编程方式更改 Selectric 下拉列表值的好方法是什么?我知道要设置为选中的选项的值。我不知道名称或索引。
这是我最好的尝试:
$('.store-availability').prop('selectedIndex', 3).selectric('refresh').change();
Run Code Online (Sandbox Code Playgroud)
因为我不知道索引,所以我必须首先在选项上使用 jQuery.Index() 才能找到它或类似的东西。有更清洁的方法吗?