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

How to Undo Swipe? #27

Open
PriyankaRose opened this issue Feb 21, 2017 · 5 comments
Open

How to Undo Swipe? #27

PriyankaRose opened this issue Feb 21, 2017 · 5 comments

Comments

@PriyankaRose
Copy link

Hello,

I need a way to undo the swipe (left/right). Is there a way for it?

@yanmendes
Copy link

Add this function on the JTinder js file:

undo: function () {
if(current_pane !== panes.length - 1) {
++current_pane;
panes.eq(current_pane).animate({"transform": "translate(0px,0px) rotate(0deg)"}, $that.settings.animationRevertSpeed);
panes.eq(current_pane).find($that.settings.likeSelector).css('opacity', 0);
panes.eq(current_pane).find($that.settings.dislikeSelector).css('opacity', 0);
panes.eq(current_pane).show();
}
},

To call it from your file simply do $('#tinderslide').jTinder('undo');

@nikhilthegrizzlybear
Copy link

Does this still work yanmendes by any chance?

@yanmendes
Copy link

Yes, it does

@Israel2709
Copy link

Hi! how can I implement this undo function on an onclick event of a button?

@yanmendes
Copy link

$(document).on("click", "#undo", function (e){ $('#tinderslide').jTinder('undo'); });

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

4 participants