是
的返回值$(element).index();
兼容 CSS nth-child(index)
?
我做了一些测试,似乎是这样。有人可以确认吗?
最佳答案
没有... index()
是基于 0
的索引,而 nth-child
使用 1
基于索引
演示:Fiddle
关于javascript - $.index() 等同于第 n 个 child 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20291002/