Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Scrolling is too fast #3

Closed
steffenborup opened this issue May 7, 2013 · 2 comments
Closed

Scrolling is too fast #3

steffenborup opened this issue May 7, 2013 · 2 comments
Assignees
Labels

Comments

@steffenborup
Copy link

Thanks for a great plugin! I am using it together with Sencha Touch 2.2 and everything works perfectly, except that the covers move way too fast when dragging. Any idea on how to resolve this?

@steffenborup
Copy link
Author

I changed the onDrag function to the following, and now everything runs smoothly:

onDrag: function(e){
    var curr = this.getOffset(),
        offset,
        ln = this.getViewItems().length,
        selectedIndex,
        delta = (e.deltaX - e.previousDeltaX);

    //slow down on border conditions
    selectedIndex = this.getSelectedIndex();

    if ((selectedIndex === 0 && e.deltaX > 0) || (selectedIndex === ln - 1 && e.deltaX < 0)) {
        delta *= 0.5;
    }

    offset = curr + delta;

    this.setOffset(offset, true);
},

@ghost ghost assigned elmasse May 14, 2013
@elmasse
Copy link
Owner

elmasse commented May 14, 2013

Edited: applied onDrag as stated in previous comment.

Sorry @steffenborup I just see this issue, for some weird reason it didn't go thru my email :(
Anyway, I will mark this as feature request to add frictionFactor property so you can modify the drag velocity without having to override any function.

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

No branches or pull requests

2 participants