Running into a problem with the scrollmagic 'section wipes (natural)' activation. What I have in my wordpress theme:
functions.php
wp_enqueue_script( 'tweenmax' );
wp_enqueue_script( 'scrollMagic' );
wp_enqueue_script( 'scrollMagicPlugin' );
wp_enqueue_script( 'scrollMagicDebug' );
wp_enqueue_script( 'sceneControls' );
the scene controller is sceneControls.js and includes
sceneControls.js
$(function () { // wait for document ready
// init
var controller = new ScrollMagic.Controller({
globalSceneOptions: {
triggerHook: 'onLeave'
}
});
// get all slides
var slides = document.querySelectorAll(".section");
// create scene for every slide
for (var i=0; i<slides.length; i++) {
new ScrollMagic.Scene({
triggerElement: slides[i]
})
.setPin(slides[i])
.addIndicators() // add indicators (requires plugin)
.addTo(controller);
}
});
I am receiving console errors however, I may be including sceneControls.js in a bad manner.
Console Readout
Uncaught TypeError: $ is not a function
Any thoughts, have tried several variations:
wp_enqueue_script( 'sceneControls' );
Help is greatly appreciated! Thank you in advance!
This was revised. Rnevius after changing the function to a noConflict. The console no longer shows an error but the behaviour is not there.