The solution to stutter when using transition on some Android phones

A project done with react has a list page in which the contents of the list need to be animated with expansion and contraction, which I implemented using css3"s transition. The code is as follows:

  .am-card-body {
    max-height: 1.3rem;
    overflow: hidden;
    transition: max-height 600ms;
  }
  .am-card-body.expand {
    max-height: 4rem !important;
  }

but on some old Android machines, the unfolding and shrinking animation showed serious stutters, and it was found that transition had a high performance overhead. I tried to turn on GPU acceleration, but it was still not smooth enough.

is there any good solution?

Jan.12,2022

1.CSS3 animation is already more efficient than JS.
2. Enable GPU acceleration, transform: translateZ (0);
3. If the Android version you are referring to is lower than 4.4, I don't think you need to think about it.

Menu