Jump to content
GreenSock

Greg Stager

Draggable - onDrag - PC vs Mobile

Recommended Posts

I created a "calculator" that uses draggable sliders to set the various values associated with each one.

It seems to function exactly as expected on a PC.

However, when pulling it up on an iPad - the sliders will respond to touch and go up and down just fine but the values will only change once instead of changing constantly along the full range of the slider. The sliders do not lock up or anything - they continue to move but it seems the onDrag function does not fire after the first time like it does on the PC.

 

Is there another consideration related to this that I should have in mind when making something work on mobile?

 

Here is an example of the code for one of the slider knobs.

Draggable.create("#knob3c", {
type: "y",
bounds: {minY: 0, maxY: -180},
onDrag: function() {
y3Pos=Math.ceil((this.y*-50)/1000)*1000;
cap();
calc();
}
});

As the slider moves it should constantly update the calculations by determining a value based on slider position and calling a couple other functions to deliver the final result. Again - it works fine on PC.

 

Link to comment
Share on other sites

My guess is that the OS or browser is not reporting things correctly. Could you please create a minimal test case for us to try out?

Link to comment
Share on other sites

I put as much of the thing together as I could in code pen but was not able to re-create the failure.

I am beginning to think the problem is something else my authoring environment is doing that breaks it when interacting on mobile.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×