将 ScrollMagic 安装到 Sails.js 生成的网络应用程序中

Installing ScrollMagic into a Sails.js generated web app

我正在使用 Node.js 和 sailsjs

我想在工作中使用 ScrollMagic (http://janpaepke.github.io/ScrollMagic/),以利用滚动条(视差等)。

我无法从两者的文档中了解如何启用这些功能。

我尝试 "npm install scrollmagic" 在我的应用程序文件夹中,我还尝试手动将 .js 文件复制到我的 assets/js 和我的 assets/js/dependancies。

两者似乎都无法正常工作。

这是我在 github https://github.com/yhattav/Vitae

上的存储库

感谢您的宝贵时间和帮助! 约纳坦.

这是我在文档中找到的:

To implement animations, ScrollMagic can work with multiple frameworks. The recommended solution is the Greensock Animation Platform (GSAP) due to its stability and feature richness. For a more lightweight approach the VelocityJS framework is also supported. Alternatively custom extensions can be implemented or the necessity of a framework can be completely avoided by animating simply using CSS and class toggles.

所以你需要去这里: http://greensock.com/gsap 并下载 TweenMax 库并将其作为 js 依赖项添加到项目的资产中。

此外,您的 main.js 文件中有一个小错字: ScrollMagic.scene 应该是大写的 s,像这样 ScrollMagic.Scene