Check in element is present onScreen

If you use Waypointsjs with Ionic 4, you can try a configuration similar to this:

const homeContent = document.querySelector('.homeContent')
const innerScroll = homeContent.shadowRoot.querySelector('.inner-scroll')
const element = homeContent.querySelector('.my-element')
const waypoint = new Waypoint({
  context: innerScroll,
  offset: '30%',
  element: element,
  handler: function (direction) {
    console.log('on scrolling', direction, this.element)
  }
})

It works very well, check my website => https://proyecto26.com/

Regards, Nicholls

1 Like