waypoints icon indicating copy to clipboard operation
waypoints copied to clipboard

Waypoint refreshAll not works

Open krishna19 opened this issue 11 years ago • 4 comments

The waypoint trigger point was not refresh when using refreshAll, but when the browser resizes the trigger point was calculated correctly. Please help

$('#waypoint-trigger').waypoint({
    handler: function(direction) {
        if (direction === 'down') {
            // Code Here
        } else if (direction === 'up') {
            // Code Here
        }
    }
});

$('.waypoint-refresh').on('click', function() {
    Waypoint.refreshAll();
});

Thanks

krishna19 avatar Jul 15 '15 04:07 krishna19

Do you have a minimal example with your html? You could use codepen or jsbin to provide us with your code :-)

stehefan avatar Jul 15 '15 13:07 stehefan

Whenever toggle is active the hidden element activated before the trigger point is reached, but whenever the window is resized it works perfectly.

http://codepen.io/kumarm80/pen/KpeJQb

Thanks

krishna19 avatar Jul 15 '15 17:07 krishna19

After youn slide out the menu, you have to refresh your waypoints because their triggerpoint was moved as well. You can do this by adding Waypoint.refreshall to your slideToggle-function.

Look here: http://codepen.io/stehefan/pen/mJKvZX And here for an explanation of the addition: slidetoggle with oncomplete & refreshAll

stehefan avatar Jul 15 '15 18:07 stehefan

Thanks @stehefan

krishna19 avatar Jul 15 '15 18:07 krishna19