You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I was trying to use this great script with a lower number of images (15-20) and noticed that dragging from right to left was a bit clunky (while left to right worked beautifully.
I realized the problem was the Math.ceil used in the trackPointer function, with negative numbers it doesn't produce the expected output (this doesn't occur when you're using many more images, of course).
A simple if using Math.floor for negative numbers does the trick and everything works just fine now.
Hello, I was trying to use this great script with a lower number of images (15-20) and noticed that dragging from right to left was a bit clunky (while left to right worked beautifully.
I realized the problem was the Math.ceil used in the trackPointer function, with negative numbers it doesn't produce the expected output (this doesn't occur when you're using many more images, of course).
A simple if using Math.floor for negative numbers does the trick and everything works just fine now.
if (pointerDistance > 0) {
endFrame = currentFrame + Math.ceil((totalFrames - 1) * speedMultiplier * (pointerDistance / $container.width()));
} else {
endFrame = currentFrame + Math.floor((totalFrames - 1) * speedMultiplier * (pointerDistance / $container.width()));
}
The text was updated successfully, but these errors were encountered: