Topic: Rotating card height with collapse

lassekofoed free asked 4 years ago

Expected behavior When a collapse is unfolded the card height expands with it.

Actual behavior Card wrapper stays same height

When using a collapse element inside a rotating card, the card-wrapper height is not updated.

Resources (screenshots, code snippets etc.)

This helped me: the code giving above, I handle it this way

$('.card-rotating .collapse').on('', function () {

$('.card-rotating .collapse').on('', function () {    

function AdjustCardWrapperMinHeight(cardId) {
    var frontHeight = $("#" +cardId).find("div.front:first").height();    
    var backHeight = $("#" + cardId).find("div.back:last").height();

    var height = frontHeight;
    if (backHeight > height) {
        height = backHeight;
    //My minimum height had to be 500.
    if (height < 500) {
        height = 500;
    $("#" + cardId).parents("div.card-wrapper").css("min-height", height);

As the event used is when animation is done, there is no smooth transition.Maybe this should be part of the Core ?

Mateusz Łubianka staff commented 4 years ago

Hi @lassekofoed, please, create a snippet showing your problem here: I'll try to help you.


Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.14.0
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: Yes