Sorry guys, my question might not be entirely related to Tweenmax or animations ( ) !!
I stuck with the piece of code below where basically we animate sections with mousewheel . Each sections has it's own animations (intro and outro) .And i stuck at the end trying to concatenate functions and call them. I already ask on stackoverflow but their solutions is not something i'm confortable with yet.
Here is the sample code
var siteGlobal = (function(){
init();
var init = function(){
bindEvents();
}
// then i got my function to bind events
var bindEvents = function(){
$(document).on('mousewheel', mouseNav());
$(document).on('keyup', mouseNav());
}
// then i got my function here for capture the event
var mouseNav = function(){
// the code here will capture direction
// nextSection();
}
var nextSection = function(){
// Here we check if there is prev() or next() section
// if there is do the change on the section
// switchSection();
}
var switchSection = function(nextsection){
// Get the current section and remove active class
// get the next section - add active class
// get the name of the section with data-name attribute
// throw the animation
var myFunctionOnEnter = window['section'+ Name + 'Exit'];
}
// Let's pretend one section is call Intro
var sectionIntroExit = function(){
// animation code here
}
}();
Calling myFunctionOnEnter() doesn's seems to work..What did i do wrong?