Jump to content
Search Community

miks

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by miks

  1. miks

    GSAP slider over scroll

    Oh, what I mean is after using your code the swipe won’t work anymore. But the scroll does. ?
  2. miks

    GSAP slider over scroll

    Hi @Acccent, I encountered a new problem, now is I couldn't use the swipe on my trackpad to move to sections. Thanks!
  3. miks

    GSAP slider over scroll

    Hi @acccent Thank you so much for this. It worked perfectly. One last question about the delay. The only thing that works for me is 0.2. What would you recommend or what is the min and max for this? Cheers!
  4. Hi Guys, I hope you can help me to fix the over scrolling on this slider. I forked this slider animation from @Ihatetomatoes tutorial. And added a mouse-wheel function that makes it scroll up and down using the existing function that Peter use but what I want to achieve is not to over scroll(not the infinite scroll) it to other section. And even if I hot scroll the wheel it will just snap onto the next slide. Best Regards, Mikhail Villamor
  5. Hi @Visual-Q, Thank you so much for this. It made more sense to me cleaner and less. @Visual-Q, I wonder why it snaps to a couple of section when I overscroll the mouse wheel.
  6. Hi @Kingsley88, I'm just starting my GSAP journey with this reply. I hope this pen could also help you. It was forked from Gray Ghost and I copied the mouse wheel scroll from @Sahil. I just added this code which still I don't fully understand to make the snap section thing from Sahil's pen. I also don't know which one is better cause sometimes when I scroll I saw some glitch/jitter thingy. var $navs = $('.anchor-nav a'); window.addEventListener("wheel", onWheel); function onWheel(event) { event.preventDefault(); var normalized; var delta = event.wheelDelta; var scroll = (window.pageXOffset || document.scrollLeft) - (document.clientLeft || 0) || 0; if (delta) { normalized = (delta % 120) == 0 ? delta / 120 : delta / 12; } else { delta = event.deltaY || event.detail || 0; normalized = -(delta % 3 ? delta * 10 : delta / 3); } var currentIndex = $navs.index($('.active')); var newIndex; newIndex = normalized > 0 ? currentIndex + 1 : currentIndex - 1; if(newIndex >=0 && newIndex < $navs.length){ $navs.eq(newIndex)[0].click() } }
×
×
  • Create New...