Closed onlybrian closed 8 years ago
Yes this should be possible. Easiest would probably be to set trigger
to 'manual'
and take matters into your own hands. You can detect whether a node is flipped or not by reading $('#your-element').data('flipped')
Cool, I got it to work, thanks. Although my javascript is rusty, here's what I did.
$(".element").on('flip:done', function() {
var isFlipped = $(this).data('flipped');
if (isFlipped) {
$(this).parent().siblings().children().flip(false);
}
});
Great that you solved it and thanks for posting your solution!
@JemarJones Your events being set to good use :)
This looks great! Though one thing here that I'm sort of wary of is relying on the data-flipped attribute in client code. This is sort of part of the internal representation rather than the API and is (in my mind) something that could be changed. I guess I hadn't really considered that data attributes are of course, public.
I suppose we could just consider those attributes as part of the API and make sure not to change them whilst moving forward.
Or we could implement something like:
var isFlipped = $(this).flip('flipped');
The question is how much better that really is... Personally I think it's fine the way it is now.
I'm fine with leaving it the way it is (people may already be relying on it), and just making sure not to change it.
Is it possible to have one object flipped at a time? When one object is flipped, any other objects that were flipped, gets unflipped. Thanks