I have a parent with li, and pointing to li, I want to get it as a child.
For this, I used:
li.index()
Now ... I have one more condition, it should find the index only among these child elements that have a mapping: the block property in css.
I tried some other methods, but I could not solve it. Any ideas?
Edit : PS: or rather, for those that don't have a display: none property.
EDIT 2 : Well, all of this requires a reference to the parent or specific identifiers, but what if they only have a pointer to li, for example:
<ul>
<li>Foo</li>
<li>Bar</li>
<li>Fiz</li>
<li>Buz</li>
</ul>
li=$('li:nth-child(n)');
Now suppose I know only one variable, and I want this index among them that do not have a css display: none propery ...
:
li.add(li.siblings()).filter(':visible').index( li );
, .:)