Your JS has basically two errors.
You have one parenthesis (")") too many.
$(document).ready(function($)) { ^^ --> one of those
You are using version ScrollMagic > = 2 (what you need), but use their functions from version 1 . Here is their documentation for current versions.
The correct way to initialize container and scene now:
var container = new ScrollMagic.Container({...}); var scene = new ScrollMagic.Scene({...});
When applying these changes, a working example of your code might look like this :
$(document).ready(function ($) { var controller = new ScrollMagic.Controller(), tween = TweenMax.to(".katrori", 0.5, {opacity: 1, backgroundColor: "#1d1d1d"}), scene = new ScrollMagic.Scene({triggerElement: "#trigger"}); scene .setTween(tween) .addTo(controller); });
You can also see their examples .
EDIT
Bulletpoint 2 Supplement :
In ScrollMagic version 1, container and scene were initialized in a script as follows:
var controller = new ScrollMagic({ *global options applying to all scenes added*}); var scene = new ScrollScene({ *options for the scene* })
In version 2, the same thing is done as follows:
var container = new ScrollMagic.Container({...}); var scene = new ScrollMagic.Scene({...});
That is why you script did not work before. styling is still done in CSS .
source share