Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Sliding Speed #11

Open
aylacullen opened this issue Jul 19, 2017 · 1 comment
Open

Initial Sliding Speed #11

aylacullen opened this issue Jul 19, 2017 · 1 comment

Comments

@aylacullen
Copy link

Too slow for sliding speed when it first loads, swiping on it will make scroll faster.

Would like to add option where I can set the speed it is moving at (without any interaction from user). Would also like another option where I can set max speed it moves at when the user swipes the image. Right now it moves too quickly when the user swipes at it.

Side note: thanks for making this!

@aylacullen
Copy link
Author

Solved initial sliding speed issue by adding initialspeedboost option:

var settings = jQuery.extend({
				dampingFactor: 0.93,
				historySize: 5,
				autorotation: 0,
                continuous: 1,
                initialspeedboost: 0

and:

var tick = function () {
				if (!armed && dx!==0) {
					dx *= settings.dampingFactor;
                    offset -= dx;
                    offset -= (dx + settings.initialspeedboost)
					checkOffset();
					container.css('background-position', offset);
					if (Math.abs(dx) < 0.001) {
						dx = 0;
					}
				}
			};

Then just set initialspeedboost to something like 8 and it'll move alot faster. Not the best solution, but it works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant