janpaepke / ScrollMagic

The javascript library for magical scroll interactions.
http://ScrollMagic.io
Other
14.9k stars 2.17k forks source link

Feature Request: Is Intersection observer is supported? #751

Open shmdhussain opened 6 years ago

shmdhussain commented 6 years ago

Thanks team for giving us this nice plugin, Like to know one thing , Is intersection observer is supported in scrollmagic? else do you have any plans to do it in future?

dangelion commented 5 years ago

Since Intersection Observer is getting famous, is it on the road?

katerlouis commented 5 years ago

Also interested in the status here: Is it coming?

Would you guys say IntersectionObserver results in better performance compared to this ScrollMagic pattern for playing videos only in view?

document.querySelectorAll("video.play-in-view-only").forEach((video) => {
  let scene = new ScrollMagic.Scene({
    triggerElement: video,
    triggerHook: 1,
    duration: () => window.innerHeight + el.clientHeight
  })
  .on("enter", () => { video.play() })
  .on("leave", () => { video.pause() })
  .addTo(controller)
})
dangelion commented 4 years ago

@katerlouis interesting question. I'm interested too in an answer

stevengrimaldo commented 4 years ago

I'm also interested in how the Intersection Observer can be used either within/with this library.