gpt4 book ai didi

jquery - 获取可见li :last and not hidden li:last

转载 作者:行者123 更新时间:2023-12-01 06:17:24 27 4
gpt4 key购买 nike

我想用 li:last 做点什么:

var p = $("li:last");

我需要它的位置:position.left

通过该位置,我可以对齐一些元素。问题是,在某些情况下,最后一个 li 被 event.hide“隐藏”,这意味着我得到 position.left 0 这意味着该元素没有对齐,因为值为 0。

如何获取所有可见 li 中的最后一个 li? (所以隐藏的 li 不应该一起玩)

最佳答案

尝试 $("li:visible:last") -> 使用 :visible 选择器。

关于jquery - 获取可见li :last and not hidden li:last,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10231100/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com