0

I am trying to combine two different actions on my website, and since I'm a beginner in javascript and scrollmagic, I've been struggling to make it all work together. I've managed to make each set of actions work individually. I based my code on the tutorials from Jan Paepke. Here is the link to the page I'm working on :

Multiple scrollmagic actions website

  1. The first set of actions is a tween to the left and right as you scroll down.
  2. The second set of actions is simply to be able to have a scrollTo action from each of the the second nav-links (page-nav) to their sections (#tags).

When troubleshooting it, I've noticed that the thing that makes one or the other work exclusively, is if I include the

<script type="text/javascript" src="js/scrollmagic/ScrollMagic.js"></script>

script (which was included in the ScrollTo tutorial. It seems that the former script and the jquery

<script type="text/javascript" src="js/scrollmagic/jquery.scrollmagic.js"></script>

files are stepping on each other's toes so to speak. If one is included and not the other, that's the action which will work on my .html. Anyways, I've been struggling with this for a while and I'm not familiar enough with different jquery.scrollmagic or ScrollMagic.js internal ramifications to solve this.

This would be very helpful to me if you anyone has a solution or thought! I m sure there might be a more straightforward way to get at this but I can't seem to find it online... Thanks,

Adrien

user21665
  • 11
  • 3

1 Answers1

0

You have several versions mixed up here.

jquery.scrollmagic.js is the old library file for version 1.x
ScrollMagic.js is the current library for file for version 2.x.
plugins/jquery.ScrollMagic.js is the jQuery extension for version 2.x

You will find each of these informations in the head section of the respective file.

As you found out yourself you can't use two different versions at the same time, as they would "step on each other's toes".

I strongly recommend learning more about how ScrollMagic works in its wiki.
Furthermore you should read and follow the troubleshooting guide. Especially the part about checking your console for helpful information I can not stress enough.

The syntax has changed from ScrollMagic 1.x to 2.x so my guess is your issues reside in the fact, that one uses the old syntax and one uses the new one. And that's definitely something you can figure out, if you use your console.

Jan Paepke
  • 1,997
  • 15
  • 25