This is hiding everything and not excluding the selected index.
this.showGroup = function(groupIndex) {
var $groups = $("#products > li.group");
// Hide all groups apart from selected index
$groups.not(groupIndex).find(".scroller").hide();
// Show selected index
$groups.eq(groupIndex).find(".scroller").slideDown();
I can’t change the first line $groups because this is used further down my function and needs to select all of the groups.
Depending on your HTML, you probably want
If you don’t want to build a selector, you can use filter :