0
여러 개의 요소가 여러 행에 배치되어 있습니다. Waypoints 인스턴스를 호출하고 있습니다.한 번에 얼마나 많은 Waypoint 인스턴스를 전환 할 수 있는지 어떻게 알 수 있습니까?
<div class="row">
<div class="col-xs-6 col-sm-4"><div class="foo"></div></div>
<div class="col-xs-6 col-sm-4"><div class="foo"></div></div>
<div class="col-xs-6 col-sm-4"><div class="foo"></div></div>
<div class="col-xs-6 col-sm-4"><div class="foo"></div></div>
<div class="col-xs-6 col-sm-4"><div class="foo"></div></div>
<div class="col-xs-6 col-sm-4"><div class="foo"></div></div>
</div>
나는 인스턴스 (같은 줄에있는 .foo
각 요소에 대한 예)를 한 번에 호출되어 얼마나 많은 웨이 포인트의 계산해야합니다
var total = 0;
$('.foo').each(function() {
$(this).waypoint({
handler: function(direction) {
total++;
}
});
});
위의 코드는 그것을하지
그러나 첫 번째 행은 두 번째 행의 항목이 활성화되어 두 번째 행의 항목에 대한 Waypoint 인스턴스를 계산하는 등의 작업을 수행하기 전에 어떻게 재설정해야하는지 잘 모릅니다. 어떤 아이디어?
궁금한 점이 있다면 waypoints 인스턴스가 플러그인에 의해 자동으로 그룹화되므로'this.group.waypoints.length'를 사용하여 내가 찾고있는 것을 얻을 수 있습니다. – sdvnksv