自定义选择框的表索引问题
tabindex issue with custom select box
我从谷歌找到了这个脚本。但它不能与tabindex一起工作。你能帮我修一下这个吗?
这里是jsfield链接
js代码段:-
$('select').each(function () {
// Cache the number of options
var $this = $(this),
numberOfOptions = $(this).children('option').length;
// Hides the select element
$this.addClass('s-hidden');
// Wrap the select element in a div
$this.wrap('<div class="select"></div>');
// Insert a styled div to sit over the top of the hidden select element
$this.after('<div class="styledSelect"></div>');
// Cache the styled div
var $styledSelect = $this.next('div.styledSelect');
// Show the first select option in the styled div
$styledSelect.text($this.children('option').eq(0).text());
// Insert an unordered list after the styled div and also cache the list
var $list = $('<ul />', {
'class': 'options'
}).insertAfter($styledSelect);
需要使用jQuery动态设置tabindex
//Adds tabindex dynamically
$this.attr("tabindex", "0");
http://jsfiddle.net/elitownsend/BB3JK/4733/相关文章:
- 使用scrollmagic时出现z索引问题
- Javascript中的多维数组排序索引问题
- 奇怪的索引问题
- Rails AJAX 销毁 - 重新渲染索引问题
- NamedNodeMap对象内部的Attr对象索引问题
- jQuery淡入淡出元素的Z索引问题
- z索引问题2
- 可拖动和可丢弃的z索引问题
- Javascript循环索引问题
- Jscrollpane z索引问题
- Lawnchair索引问题
- @{{#each}}内部的索引问题
- javascript/css转换+谷歌chrome的z索引问题
- 自定义选择框的表索引问题
- 非稀疏数组中的数组索引问题
- 删除一个项目,索引问题…
- javascript查找索引问题与IE
- 通过ajax发送多维数组,索引[0]问题
- 未定义的索引问题和错误返回
- select2的表索引问题