【发布时间】:2013-12-15 23:01:58
【问题描述】:
是
的返回值$(element).index();
与 CSS nth-child(index) 兼容?
我做了一些测试,看起来确实如此。有人可以确认吗?
【问题讨论】:
标签: javascript jquery css indexing css-selectors
是
的返回值$(element).index();
与 CSS nth-child(index) 兼容?
我做了一些测试,看起来确实如此。有人可以确认吗?
【问题讨论】:
标签: javascript jquery css indexing css-selectors
不...index() 是基于0 的索引,而nth-child 使用基于1 的索引
演示:Fiddle
【讨论】: