Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$(".subTab").css("left", $(this).parent("ol").position().left);
亲爱的 JQuery 用户,为什么上面的方法不起作用?
this在您的代码中没有引用所选元素(subTab)。
this
$(".subTab").css("left", function(){ return $(this).closest("ol").position().left; })