Jump to content
Search Community

Steve

Premium
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Steve

  1. I figured it out. Here is the function that I put inside the Jquery UI slider object: $("#slider").slider({ stop: function(event){ var p = tl.progress(); var intervals = [0,.9,.18,.27,.36,.45,.54,.63,.72,.81,.9]; var closest = intervals.reduce(function(prev, curr) { return (Math.abs(curr - p) < Math.abs(prev - p) ? curr : prev); }); if ( p != intervals) { tl.progress(closest); } event.stopPropagation(); } }); Snapping awesome!! Thanks!!
  2. I built a Timelinemax Carousel with 11 cards and mapped them to a Jquery UI slider. The next/back functions move .9 of progress() which works fine. The only issue is if the Jquery slider is used and the carousel is not exactly on one of the 11 progress intervals. So I'd like to snap the progress to the 11 progress intervals, .9, .18, .27, etc. Thanks very much for your help.
  3. Is there any way to have snapping on Timeline progress()? Snapping to fixed intervals such as .1, .2, .3 of the progress()? Thanks for your consideration!
×
×
  • Create New...