nnattawat / flip

A lightweight jQuery plugin to make 3D card flipping animation
Other
626 stars 312 forks source link

How do you query the current face? #82

Closed nishantpant closed 8 years ago

nishantpant commented 8 years ago

I would like to find out which face is currently being shown? Is there a way to achieve this?

JemarJones commented 8 years ago

There isn't currently an official way to do this.

However, the way flip is currently implemented, each card has a data attribute such that the following works:

//When the card hasn't been flipped (ie the front face is being shown)
$('#card').data("flipped") == false

//When the card has been flipped (ie the back face is being shown)
$('#card').data("flipped") == true

This however is not officially part of our API, so i cannot guarantee that this is how it will always work in the future.

I also suspect this could be figured out with a bit of jQuery.