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.
我想动态显示附加列表中的前 5 个元素。我试过这个,但它不工作:
$(this).find("element").each(['1','2','3'], function (){... $("#rounded_items").append('<li id="'+ level +'"><div class="item_pocket"><img src="'+ image +'" class="image"/><span>'+ name +'</span></div></li>')
尝试
$(this).find("element:lt(5)").each(function(){...}