Hi. I am totally new to GS. I am watching the ihatetomatoes GS101 – 01 – ScrollTrigger Basics and I get the following error writing the exact same code as in the video.
gsap.registerPlugin(ScrollTrigger);
function init(){
gsap.to('#intro img', { opacity: 0, scrollTrigger: { trigger: '#intro', start: 'top top', scrub: true, markers: true } })
}
window.addEventListener('load', function(){
init();
});
after loading the js in the html file
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.2.4/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ScrollTrigger/1.0.5/ScrollTrigger.min.js"></script>
<script src="js/main.js" defer></script>
Invalid property scrollTrigger set to
Object { trigger: "#intro", start: "top top", scrub: true, markers: true }
Missing plugin? gsap.registerPlugin()
I google the error but can not find what is the problem... most probably a stupid little thing...
Any idea?
update... I found that the version of gsap and scrolltrigger could be incompatrible so I change the html file but now nothing is changing when scrolling.
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.0/gsap.js">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.0/ScrollTrigger.js">