do-web / jTinder

jTinder is a javascript library that makes rating people, products, images very easy and fast. It is optimized for mobile touch device but has also a desktop fallback.
GNU General Public License v2.0
235 stars 101 forks source link

Create multiple jTinder sliders #7

Closed melledijkstra closed 6 years ago

melledijkstra commented 9 years ago

Hi,

Thank you for creating this amazing plugin. There is only a drawback. I don't seem to be able to create more then 1 jTinder slider.

Is this functionality in the plugin? If not, maybe it would be a nice addon.

Just saying.

Melletjee

supasheva commented 8 years ago

Have you been able to solve this issue? When you say you don't seem to be able to create more than 1 Jtinder slider what scenario are you talking about?

melledijkstra commented 8 years ago

It's a long time ago since I posted the question.

But I had a problem instantiating multiple jTinder objects. When you would swipe the first one the second jTinder slider would also react to that function. Easy said, the 2 jTinder sliders were actually 1 and wouldn't react apart from each other.

But maybe it has been fixed now :?

Like this:

$("#first_jTinder").jTinder({
    onLike: function (item) {
        // this also triggers the second onLike jTinder slider
    }
});

$("#second_jTinder").jTinder({
...
});
haveabyte commented 8 years ago

MelleDikstra, I'm also interested in a solution to this.

haveabyte commented 8 years ago

@MelleDijkstra I figured it out. If you still need it, let me know.

melledijkstra commented 8 years ago

@haveabyte Good job! But I don't need it anymore. Thanks anyway!

thomhos commented 8 years ago

Can you guys comment on how this was solved?

daybaryour commented 8 years ago

@haveabyte Can you help post on how you were able to resolve this? thanks in advance

thomhos commented 8 years ago

I was able to solve this, ill try to post some help tomorrow or this week.

*EDIT: This actually has to do with the 'this' context in this plugin. It's always referring to the first object you created. Use the proper context and you'll be fine.

haveabyte commented 8 years ago

I actually posted this up to a URL to work on it and kind of forgot about it. So I don't remember how it all works, but if anyone wants, go grab the code from the page and try to figure out what the heck I actually did. :)

http://swipe.haveabyte.com/