Share Posted June 22, 2022 https://pandplus.com/ you can check console for error other plugins are working fine but not smoothscroller please help !!! import gsap from "gsap" import $ from "jquery"; import ScrollTrigger from 'gsap/ScrollTrigger' import {ScrollSmoother} from "gsap/ScrollSmoother"; import DrawSVGPlugin from "gsap/DrawSVGPlugin"; import MorphSVGPlugin from "gsap/MorphSVGPlugin"; gsap.registerPlugin(ScrollTrigger, ScrollSmoother, DrawSVGPlugin, MorphSVGPlugin) ScrollSmoother.create({ smooth: 1, // how long (in seconds) it takes to "catch up" to the native scroll position }); { "private": true, "scripts": { "dev": "npm run development", "development": "mix", "watch": "mix watch", "watch-poll": "mix watch -- --watch-options-poll=1000", "hot": "mix watch --hot", "prod": "npm run production", "production": "mix --production" }, "devDependencies": { "@babel/plugin-syntax-top-level-await": "^7.14.5", "alpinejs": "^2.7.3", "autoprefixer": "^10.4.7", "axios": "^0.21", "laravel-mix": "^6.0.43", "lodash": "^4.17.19", "postcss": "^8.4.13", "postcss-import": "^12.0.1", "resolve-url-loader": "^4.0.0", "rtlcss": "^3.4.0", "sass": "^1.51.0", "sass-loader": "^12.6.0" }, "dependencies": { "@popperjs/core": "^2.10.2", "@splidejs/splide": "^3.6.12", "animate.css": "^4.1.1", "bootstrap": "^5.1.3", "bootstrap-icons": "^1.8.1", "gsap": "npm:@gsap/shockingly@^3.10.4", "jquery": "^3.6.0", "wow.js": "^1.2.2" } } Link to comment Share on other sites More sharing options...
Share Posted June 22, 2022 import ScrollTrigger from 'gsap/ScrollTrigger' You missed a semi colon ; ? --- and on the first line Link to comment Share on other sites More sharing options...
Share Posted June 22, 2022 @Pandplus You have to wrap your content in the proper wrappers. As per the docs: <div id="smooth-wrapper"> <div id="smooth-content"> <!--- ALL YOUR CONTENT HERE ---> </div> </div> <!-- position: fixed elements can go outside --> 1 Link to comment Share on other sites More sharing options...
Share Posted June 22, 2022 It's pretty tough to troubleshoot without a minimal demo - the issue could be caused by CSS, markup, a third party library, your browser, an external script that's totally unrelated to GSAP, etc. Would you please provide a very simple CodePen or CodeSandbox that demonstrates the issue? Please don't include your whole project. Just some colored <div> elements and the GSAP code is best (avoid frameworks if possible). See if you can recreate the issue with as few dependancies as possible. If not, incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, then at least we have a reduced test case which greatly increases your chances of getting a relevant answer. Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo: See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen If you're using something like React/Next/Nuxt/Gatsby or some other framework, you may find CodeSandbox easier to use. Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now