imakewebthings / waypoints

Waypoints is a library that makes it easy to execute a function whenever you scroll to an element.
http://imakewebthings.com/waypoints/
10.38k stars 1.33k forks source link

Offset with Inview? #577

Open hackuun opened 7 years ago

hackuun commented 7 years ago

I there an option to use offset with Inview?

I tried following this, but this is doesn't work

let waypoint = new Waypoint.Inview({
      element: document.querySelector('.waypoint'),
      entered: (direction) => {
        console.log(direction)
        this.waypointed = true
      },
      exited: (direction) => {
        console.log(direction)
        this.waypointed = false
      },
      offset: {
        top: 150,
        bottom: 150
      }
    })

Found here - https://github.com/imakewebthings/waypoints/issues/450 How to use this?

travisbell commented 7 years ago

I literally just came looking for this.

It doesn't look like this was ever implemented, was it?

stuntbox commented 6 years ago

@iamdubx @travisbell Take a look over in this issue for some custom code that should help: https://github.com/imakewebthings/waypoints/issues/450#issuecomment-228154548