Open L1nK4R1M opened 3 years ago
I used for a scroll_top button to return to the top (outside the scroll-container) and don't need scrollTo GSAP plugin, just used locomotive and scrollTrigger (I don't know if it work without it):
$('.back_top').click(function(){
/// the var for locomotive and the method scrollTo("target");
scroll.scrollTo("top");
return false;
});
I think will be similar, to your case. You can also define a target (in this case "top" of page).
From documentation:
const target = document.querySelector('#js-target'); scroll.scrollTo(target);
I hope this can help you.
Came out with a solution. I used Scrolltrigger to hide navbar when scrolling.
Hello 👋
I have an issue with the scroll of my container. event if my navbar is outside of the container scroll. the containerscroll still scroll under the navbar and some content is hide. How can I add an offset to scroll just below the navbar without hiding the content.
here's the navbar :
I tried the scrollTo method but still doesn't work. I work on angular.
Is there a solution for that ?
Thank you 👊