Hello everybody,
I'll just get right into the work xD
here is the thing, I was trying to animate the scrolling process with tweenMax but I kinda don't know what exactly is going on
with my code.
so I'll just thought that you guys could help me with it,
here is the scrolling section (which I customized a codepen that was nearly what I wanted it) :
var wrapper = $("#wrapper"),
$menu = $(".navbar");
$menu.on("click","a", function(){
var $this = $(this),
href = $this.attr("href"),
topX = $(href).offset().left;
TweenMax.to($(window), 2, {
scrollTo:{
x: topX,
autoKill: true
},
ease:Elastic
});
return false;
});
What I want to do is, when the user clicked on the tag "a" which is in the "li" tag, the page would scroll into the specified page.
(which is Left to right, instead of top to bottom that's why I've changed the offset into left)
I don't know what is wrong with my code,
when I set the return to True, it scrolls to the page but tweenmax doesn't work!
Thank you so much,
S.Rb