Topic: Dynamically Added Flipping Card
Adam Stapleton
pro
asked 6 years ago
Adam Stapleton
pro
answered 6 years ago
For anyone else stumbling across this issue. I found the answer by searching the code on the GitLabs repo. You just need to add the class ".flipped" to the parent container with the ".card-rotating" class. So this:
Would become this:
And you could use this to apply the class when the rotate-btn was clicked:
$('a.rotate-btn').click(function (e) { e.preventDefault(); var cardId = $(this).data('card'); $('#' + cardId).toggleClass('flipped'); });
Hopefully that helps someone in the future.
Huichofer pro commented 6 years ago
Thanks Adam for this. I had the same problem and your answer led me to the current version implementation. Regards !
$('.rotate-btn').on('click', function () { var cardId = $(this).attr('data-card'); $("#".concat(cardId)).toggleClass('flipped'); });
noahrama pro commented 6 years ago
Thank You Very Much!
Huichofer's response the new correct answer
noahrama pro commented 6 years ago
Thank You Very Much!
Huichofer's response the new correct answer
Bartłomiej Malanowski staff commented 6 years ago
@Huichofer, could you please add your comment as an answer so we could mark it as the best one?
ijese free commented 4 years ago
Thanks, just what I needed!
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes