magr0s / vue-scrollmagic

Vue.js plugin
MIT License
72 stars 24 forks source link

Is there a way to specify Container? #2

Closed zFlix closed 5 years ago

zFlix commented 5 years ago

Hi! First, thanks for making this library, while I'm still working on getting it running smoothly, all of your effort to make it easier to run ScrollMagic in Vue.js is very appreciated!

So while I do see your note: "Container is always a window."

I also see in the example app:

scrollContainer () {
      return (this.info.container === window) ? 'window' : this.info.container.tagName
    }

Which kinda implies that a Container can be specified. I've tried a few different methods to do so, but have been un-successful. Figured I'd ask if there was a way to do so, or if I should just stop trying.

Thank you! -AJ

magr0s commented 5 years ago

Hi! Thank you.

It is imposible.

// src/plugin/index.js
...
controller_: new Scrollmagic.Controller(Object.assign(options || {}, {
  container: window
}))
...

Maybe in the next version along with mobile support.

zFlix commented 5 years ago

Thanks for the quick response! I might take a crack at implementing the container functionality, doesn't seem too tricky. Will send a pull request if it works :-)

magr0s commented 5 years ago

See 70ffa690328b0ab4582ca9406eebb1d7fd7579e4