Reputation: 2392
The title basically says it. It does not matter what I put in the offset param, it only fires when the element hits the top of the window.
$('.waypoint').waypoint({
handler: function(direction) {
console.log('hit');
}
}, {offset: '100%'});
I have also tried setting context manually, but the results are the same.
Upvotes: 3
Views: 1596
Reputation: 3559
Try putting the offset
as other key of the same JSON which contains handler
$('.waypoint').waypoint({
handler: function(direction) {
console.log('hit');
},
offset: '100%'});
I have seen this other way in the official documentation:
$('.waypoint').waypoint(function(direction) {
console.log('hit');
}, {
offset: '100%'
})
Upvotes: 2