如何通过左侧位置选择元素?jQuery:通过知道它的左侧位置来选择元素
我想要做这样的事情:
$(".timeline_item").find("Where left position === 300");
如何通过左侧位置选择元素?jQuery:通过知道它的左侧位置来选择元素
我想要做这样的事情:
$(".timeline_item").find("Where left position === 300");
这将返回所有.timeline_item
左== 300
$(".timeline_item").filter(function() {
return $(this).css("left") == 300;
});
您可以用.position()
检查:
$(".timeline_item").filter(function() {
return $(this).position().left == 300;
});
像这样的东西应该工作
$(".timeline_item").filter(function() {
return $(this).css("left") == 300;
});
谢谢你。我不知道过滤器存在。很酷的东西! –