Javascript jquery中children()和Slice()方法的替代方法
我在脚本中使用children()和slice()方法。我需要另一种不使用这种方法的替代方法 这就是我尝试过的: 您可以使用此方法Javascript jquery中children()和Slice()方法的替代方法,javascript,jquery,Javascript,Jquery,我在脚本中使用children()和slice()方法。我需要另一种不使用这种方法的替代方法 这就是我尝试过的: 您可以使用此方法 这将允许您使用classtopnav选择ul中的li,而不是隐藏所有子项,然后显示其中一些,只隐藏您不想要的子项: $('#thumbs').children().filter(function(index) { return (index < newstart || index >= newlimit); }).hide(); 您当前的方
这将允许您使用class
topnav
选择ul
中的li
,而不是隐藏所有子项,然后显示其中一些,只隐藏您不想要的子项:
$('#thumbs').children().filter(function(index) {
return (index < newstart || index >= newlimit);
}).hide();
您当前的方法有什么问题?也许这会有所帮助:@xdazz:当我将此脚本嵌入到我的项目中时,出现了一个问题。您可以发送Fiddle演示吗
$('#thumbs').children().filter(function(index) {
return (index < newstart || index >= newlimit);
}).hide();
$('#thumbs').find(".UiUx3DSSVFlow").filter( /*...*/ ).hide();