I am trying to add a class to the same element when Waypoint is triggered. I only want the class to the element when that specific element triggers hence I want to use $(this).
Jquery:
var $waypointAppear = $('.waypoint-appear');
$waypointAppear.waypoint(function () {
$(this).addClass('show');
}, { offset: '70%' });
HTML:
<div class="panel__text-box waypoint-appear">
<h2>Heading</h2>
<p>Text</p>
</div>
When it's triggered it doesn't append the class and returns [object Object].
Any help would be much appreciated. Thanks.