Скопируйте код кода следующим образом: var totalPanels = $(".scrollContainer").children().size(); alert(totalPanels) приводит к 2 накопление